Rider Help

Protobuf - Formatting Style

Tabs and indents

Indent style

Property names:

protobuf_indent_style, indent_style

Possible values:

  • space: Spaces
  • tab: Tab

Examples:

space
option·{ ····{ ········x1 ····} ····{ ········y2 ····} }
tab
option·{ →{ →→x1 →} →{ →→y2 →} }

Indent size

Property names:

protobuf_indent_size, indent_size

Possible values:

an integer

Examples:

value: 0
option·{ ·{ ··x1 ·} ·{ ··y2 ·} }
value: 1
option·{ ·{ ··x1 ·} ·{ ··y2 ·} }
value: 2
option·{ ··{ ····x1 ··} ··{ ····y2 ··} }

Tab width

Property names:

protobuf_tab_width, tab_width

Possible values:

an integer

Examples:

value: 0
option·{ →{ →→x1 →} →{ →→y2 →} }
value: 1
option·{ →{ →→x1 →} →{ →→y2 →} }
value: 2
option·{ →{ →→x1 →} →{ →→y2 →} }

Spaces

After comma in options

Property names:

[resharper_]protobuf_space_comma, [resharper_]space_comma

Possible values:

true | false

Examples:

true
message·{ →optional·int32·[default·1deprecated·true]; }
false
message·{ →optional·int32·[default·1,deprecated·true]; }

Around = in fields and options

Property names:

[resharper_]protobuf_space_equals, [resharper_]space_equals

Possible values:

true | false

Examples:

true
message·{ →optional·int32·[default·1deprecated·true]; }
false
message·{ →optional·int32·a=[default=1deprecated=true]; }

Before : in aggregate options

Property names:

[resharper_]protobuf_space_colon_before, [resharper_]space_colon_before

Possible values:

true | false

Examples:

true
option·{ →y, →e };
false
option·{ →xy, →ce };

After : in aggregate options

Property names:

[resharper_]protobuf_space_colon_after, [resharper_]space_colon_after

Possible values:

true | false

Examples:

true
option·{ →xy, →ce };
false
option·{ →x:y, →c:e };

Indenting options

Curly braces not in options

Property names:

[resharper_]protobuf_not_options_braces, [resharper_]protobuf_brace_style, [resharper_]not_options_braces, [resharper_]brace_style

Possible values:

  • next_line_shifted: At next line indented (Whitesmiths style)
  • next_line_shifted_2: At next line indented 2 (GNU style)
  • next_line: At next line (BSD style)
  • end_of_line: At end of line (K&R style)
  • end_of_line_no_space: At end of line (no space)

Examples:

next_line_shifted
message·a →{ →optional·int32·1; →message →b →→{ →→optional·int32·1; →→} →}
next_line_shifted_2
message·a →{ →→optional·int32·1; →→message →→b →→→{ →→→→optional·int32·1; →→→} →}
next_line
message·a { →optional·int32·1; →message →b →{ →→optional·int32·1; →} }
end_of_line
message·{ →optional·int32·1; →message →{ →→optional·int32·1; →} }
end_of_line_no_space
message·a{ →optional·int32·1; →message →b{ →→optional·int32·1; →} }

Curly/pointy braces in aggregate values in options

Property names:

[resharper_]protobuf_options_braces, [resharper_]protobuf_brace_style, [resharper_]options_braces, [resharper_]brace_style

Possible values:

  • next_line_shifted: At next line indented (Whitesmiths style)
  • next_line_shifted_2: At next line indented 2 (GNU style)
  • next_line: At next line (BSD style)
  • end_of_line: At end of line (K&R style)
  • end_of_line_no_space: At end of line (no space)

Examples:

next_line_shifted
option·= →{ →a →→{ →→x1 →→} →b →→{ →→y2 →→} →}
next_line_shifted_2
option·= →{ →→a →→→{ →→→→x1 →→→} →→b →→→{ →→→→y2 →→→} →}
next_line
option·= { →a →{ →→x1 →} →b →{ →→y2 →} }
end_of_line
option·{ →{ →→x1 →} →{ →→y2 →} }
end_of_line_no_space
option·={ →a{ →→x1 →} →b{ →→y2 →} }

Empty block style

Property names:

[resharper_]protobuf_empty_block_style, [resharper_]empty_block_style

Possible values:

  • together_same_line: Together on the same line
  • together: Place braces together
  • multiline: On different lines

Examples:

together_same_line
message·{}
together
message·{}
multiline
message·{ }

Wrapping and chopping

Right margin (columns)

Property names:

protobuf_max_line_length, max_line_length

Possible values:

an integer

Other

Use pointy braces in aggregate options

Property names:

[resharper_]protobuf_options_braces_pointy, [resharper_]options_braces_pointy

Possible values:

true | false

Examples:

true
option·{ →value1·<> →value2·<> };
false
option·{ →value1·{} →value2·{} };
Last modified: 11 October 2017