Expand description
A fast, deterministic Protocol Buffers formatter built on tree-sitter.
Structs§
- Format
Options - Formatting policy used by
crate::format_with_options.
Enums§
- Comment
Spacing - Spacing between
//and the text of a line comment. - Declaration
Spacing - Whether block-bodied declarations are always set apart by blank lines.
- Empty
Block Layout - Layout of a block with no statements.
- Empty
RpcBody - How an
rpcwith no options is terminated. - Empty
Statements - What happens to a
;that terminates nothing. - Field
Options Layout - Whether a field or enum value option list may break when it does not fit.
- Header
Order - Order of the statements that open a file, up to the first
message,enum,serviceorextend.syntaxalways comes first and fileoptions always come last; the variants choose what sits between. - Import
Order - Order of the
importstatements within the file header. - Option
Value Layout - Whether an
optionvalue may leave its statement’s line when the statement does not fit. - Quote
Style - Preferred delimiter for string literals.
- RpcSignature
Layout - Whether an
rpcsignature may break when it does not fit.
Functions§
- format
- format_
with_ options - is_
formatted - Returns whether
sourceis already formatted using the default policy, without allocating the rendered output. - is_
formatted_ with_ options - Returns whether
sourceis already formatted usingoptions, without allocating the rendered output.