VB.NET 的 EditorConfig 属性:换行
保留现有格式
保留现有换行符
属性名称:
[resharper_]vb_keep_user_linebreaks、 [resharper_]keep_user_linebreaks
可能的值:
true | false
示例:
格式化之前 | 格式化之后,真 |
|---|---|
Function Sum (x As Integer, _
y As Integer) As Integer
Return _
x + y
End Function
| Function Sum(x As Integer,
y As Integer) As Integer
Return _
x + y
End Function
|
格式化之前 | 格式化之后,假 |
|---|---|
Function Sum (x As Integer, _
y As Integer) As Integer
Return _
x + y
End Function
| Function Sum(x As Integer, y As Integer) As Integer
Return x + y
End Function
|
属性
将类型特性置于同一行中
属性名称:
[resharper_]vb_place_type_attribute_on_same_line
可能的值:
true | false
示例:
true |
|---|
<SomeAttribute> Class C
End Class
|
false |
|---|
<SomeAttribute>
Class C
End Class
|
将方法特性置于同一行中
属性名称:
[resharper_]vb_place_method_attribute_on_same_line
可能的值:
true | false
示例:
true |
|---|
<SomeAttribute> Sub Foo
End Sub
|
false |
|---|
<SomeAttribute>
Sub Foo
End Sub
|
将属性特性置于同一行中
属性名称:
[resharper_]vb_place_property_attribute_on_same_line、 [resharper_]place_property_attribute_on_same_line
可能的值:
true | false
示例:
true |
|---|
<SomeAttribute> Public Property MyProperty() As Integer
Get
End Get
Set(ByVal value As Integer)
End Set
End Property
|
false |
|---|
<SomeAttribute>
Public Property MyProperty() As Integer
Get
End Get
Set(ByVal value As Integer)
End Set
End Property
|
将事件特性置于同一行中
属性名称:
[resharper_]vb_place_event_attribute_on_same_line、 [resharper_]place_event_attribute_on_same_line
可能的值:
true | false
示例:
true |
|---|
<SomeAttribute> Public Event MyEvent()
|
false |
|---|
<SomeAttribute>
Public Event MyEvent()
|
将字段特性置于同一行中
属性名称:
[resharper_]vb_place_field_attribute_on_same_line
可能的值:
true | false
示例:
true |
|---|
Class C
<SomeAttribute> Dim x As Integer
End Class
|
false |
|---|
Class C
<SomeAttribute>
Dim x As Integer
End Class
|
换行
在以下位置硬包装
属性名称:
max_line_length、 [resharper_]vb_max_line_length
可能的值:
整数
将形参换行
属性名称:
[resharper_]vb_wrap_parameters_style、 [resharper_]wrap_parameters_style
可能的值:
wrap_if_long: 简单换行chop_if_long:如果过长或多行则分割总是拆分:始终分割
示例:
wrap_if_long |
|---|
Sub Foo(p1 As Integer, p2 As Integer,
p3 As Integer)
End Sub
|
chop_if_long |
|---|
Sub Foo(p1 As Integer,
p2 As Integer,
p3 As Integer)
End Sub
|
总是拆分 |
|---|
Sub Foo(p1 As Integer,
p2 As Integer,
p3 As Integer)
End Sub
|
首选方法声明中的 '(' 前换行
属性名称:
[resharper_]vb_wrap_before_declaration_lpar、 [resharper_]wrap_before_declaration_lpar
可能的值:
true | false
示例:
true |
|---|
Sub Foo _
(p1 As Integer, p2 As Integer,
p3 As Integer)
End Sub
|
false |
|---|
Sub Foo(p1 As Integer, p2 As Integer,
p3 As Integer)
End Sub
|
将调用实参换行
属性名称:
[resharper_]vb_wrap_arguments_style、 [resharper_]wrap_arguments_style
可能的值:
wrap_if_long: 简单换行chop_if_long:如果过长或多行则分割chop_always:始终分割
示例:
wrap_if_long |
|---|
SomeMethod(arg1, arg2, arg3, arg4, arg5)
|
chop_if_long |
|---|
SomeMethod(arg1, arg2, arg3, arg4, arg5)
|
总是拆分 |
|---|
SomeMethod(arg1,
arg2,
arg3,
arg4,
arg5)
|
首选在调用中的 '(' 前换行
属性名称:
[resharper_]vb_wrap_before_invocation_lpar、 [resharper_]wrap_before_invocation_lpar
可能的值:
true | false
示例:
true |
|---|
SomeMethod _
(arg1, arg2, arg3, arg4,
arg5)
|
false |
|---|
SomeMethod(arg1, arg2, arg3,
arg4, arg5)
|
将 extends/implements/handles 列表换行
属性名称:
[resharper_]vb_wrap_extends_list_style、 [resharper_]wrap_extends_list_style
可能的值:
wrap_if_long: 简单换行chop_if_long:如果过长或多行则分割chop_always:始终分割
示例:
wrap_if_long |
|---|
Class C
Implements Ifc1, Ifc2,
Ifc3, Ifc4
End Class
|
chop_if_long |
|---|
Class C
Implements Ifc1,
Ifc2,
Ifc3,
Ifc4
End Class
|
chop_always |
|---|
Class C
Implements Ifc1,
Ifc2,
Ifc3,
Ifc4
End Class
|
将多个声明列表换行
属性名称:
[resharper_]vb_wrap_multiple_declaration_style、 [resharper_]wrap_multiple_declaration_style
可能的值:
wrap_if_long: 简单换行chop_if_long:如果过长或多行则分割总是拆分:始终分割
示例:
wrap_if_long |
|---|
Class C
Dim x As Integer = 0,
y As Integer = 1,
s As String = ""
End Class
|
chop_if_long |
|---|
Class C
Dim x As Integer = 0,
y As Integer = 1,
s As String = ""
End Class
|
总是拆分 |
|---|
Class C
Dim x As Integer = 0,
y As Integer = 1,
s As String = ""
End Class
|
首选在二元表达式中的运算符前换行
属性名称:
[resharper_]vb_wrap_before_binary_opsign、 [resharper_]wrap_before_binary_opsign
可能的值:
true | false
示例:
true |
|---|
myField1 = expression1 _
+ expression2 _
+ expression3 _
+ expression4 _
+ expression5
|
false |
|---|
myField1 = expression1 +
expression2 +
expression3 +
expression4 +
expression5
|