ReSharper 2025.3 Help

EditorConfig 属性用于 Protobuf:格式化样式

制表符和缩进

缩进样式

属性名称:

indent_style[resharper_]protobuf_indent_style

可能的值:

  • tab: Tab

  • space: Spaces

示例:

制表符

option a = { a { x: 1 } b { y: 2 } }

空格

option a = { a { x: 1 } b { y: 2 } }

缩进大小

属性名称:

indent_size[resharper_]protobuf_indent_size

可能的值:

整数

示例:

值:0

option a = { a { x: 1 } b { y: 2 } }

值:1

option a = { a { x: 1 } b { y: 2 } }

值:2

option a = { a { x: 1 } b { y: 2 } }

制表符宽度

属性名称:

tab_width[resharper_]protobuf_tab_width

可能的值:

整数

示例:

值:0

option a = { a { x: 1 } b { y: 2 } }

值:1

option a = { a { x: 1 } b { y: 2 } }

值:2

option a = { a { x: 1 } b { y: 2 } }

制表符用于缩进时如何对齐

属性名称:

[resharper_]protobuf_alignment_tab_fill_style[resharper_]alignment_tab_fill_style

可能的值:

  • use_spaces: 使用空格(在任何制表符大小下看起来对齐)

  • use_tabs_only :仅使用制表符(不准确)

  • optimal_fill: 混合使用制表符和空格以获得最佳填充

即使结果缩进过大也要对齐

属性名称:

[resharper_]protobuf_allow_far_alignment[resharper_]allow_far_alignment

Allow alignment even if construct is located too far to the right, more than 2/3 of `Hard wrap at` limit

可能的值:

true | false

空格

选项中的逗号后

属性名称:

[resharper_]protobuf_space_comma[resharper_]space_comma

可能的值:

true | false

示例:

true

message a { optional int32 a = 1 [default = 1, deprecated = true]; }

false

message a { optional int32 a = 1 [default = 1,deprecated = true]; }

字段和选项中的 = 周围

属性名称:

[resharper_]protobuf_space_equals[resharper_]space_equals

可能的值:

true | false

示例:

true

message a { optional int32 a = 1 [default = 1, deprecated = true]; }

false

message a { optional int32 a=1 [default=1, deprecated=true]; }

聚合选项中的 : 前

属性名称:

[resharper_]protobuf_space_colon_before[resharper_]space_colon_before

可能的值:

true | false

示例:

true

option a = { x : y, c : e };

false

option a = { x: y, c: e };

聚合选项中的 : 后

属性名称:

[resharper_]protobuf_space_colon_after[resharper_]space_colon_after

可能的值:

true | false

示例:

true

option a = { x: y, c: e };

false

option a = { x:y, c:e };

缩进选项

不在选项中的大括号

属性名称:

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

可能的值:

  • end_of_line: 行尾 (K&R 样式)

  • end_of_line_no_space: 行尾(无空格)

  • next_line: 下一行 (BSD 样式)

  • next_line_shifted: 下一行缩进 (Whitesmiths 样式)

  • next_line_shifted_2: 下一行缩进 2 (GNU 样式)

示例:

end_of_line

message a { optional int32 a = 1; message b { optional int32 c = 1; } }

end_of_line_no_space

message a{ optional int32 a = 1; message b{ optional int32 c = 1; } }

下一行

message a { optional int32 a = 1; message b { optional int32 c = 1; } }

下一行缩进

message a { optional int32 a = 1; message b { optional int32 c = 1; } }

下一行缩进 2

message a { optional int32 a = 1; message b { optional int32 c = 1; } }

选项中聚合值中的大括号/尖括号

属性名称:

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

可能的值:

  • end_of_line: 行尾 (K&R 样式)

  • end_of_line_no_space: 行尾(无空格)

  • next_line: 下一行 (BSD 样式)

  • next_line_shifted: 下一行缩进 (Whitesmiths 样式)

  • next_line_shifted_2: 下一行缩进 2 (GNU 样式)

示例:

end_of_line

option a = { a { x: 1 } b { y: 2 } }

end_of_line_no_space

option a ={ a{ x: 1 } b{ y: 2 } }

下一行

option a = { a { x: 1 } b { y: 2 } }

下一行缩进

option a = { a { x: 1 } b { y: 2 } }

下一行缩进 2

option a = { a { x: 1 } b { y: 2 } }

空块样式

属性名称:

[resharper_]protobuf_empty_block_style[resharper_]empty_block_style

可能的值:

  • multiline :分行显示

  • together :将大括号放在一起

  • together_same_line :同一行放在一起

示例:

多行

message a { }

一起

message a {}

同一行一起

message a {}

换行与拆分

硬换行于

属性名称:

max_line_length[resharper_]protobuf_max_line_length

可能的值:

整数

其它

在聚合选项中使用尖括号

属性名称:

[resharper_]protobuf_options_braces_pointy[resharper_]options_braces_pointy

可能的值:

true | false

示例:

true

option a = { value1 <> value2 <> };

false

option a = { value1 {} value2 {} };
最后修改日期: 2025年 12月 8日