VB.NET 的 EditorConfig 属性:换行
保留现有格式
保留现有换行符
属性名称:
保留用户的换行, 保留用户的换行
可能的值:
true|false
示例:
格式化前 | 格式化后,true |
|---|---|
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
|
格式化前 | 格式化后,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
|
特性
将类型特性置于同一行中
属性名称:
在同一行放置类型属性
可能的值:
true|false
示例:
true |
|---|
<SomeAttribute> Class C
End Class
|
false |
|---|
<SomeAttribute>
Class C
End Class
|
将方法特性置于同一行中
属性名称:
在同一行放置方法属性
可能的值:
true|false
示例:
true |
|---|
<SomeAttribute> Sub Foo
End Sub
|
false |
|---|
<SomeAttribute>
Sub Foo
End Sub
|
将属性特性置于同一行中
属性名称:
在同一行放置属性的属性, 在同一行放置属性的属性
可能的值:
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
|
将事件特性置于同一行中
属性名称:
在同一行放置事件属性, 在同一行放置事件属性
可能的值:
true|false
示例:
true |
|---|
<SomeAttribute> Public Event MyEvent()
|
false |
|---|
<SomeAttribute>
Public Event MyEvent()
|
将字段特性置于同一行中
属性名称:
在同一行放置字段属性
可能的值:
true|false
示例:
true |
|---|
Class C
<SomeAttribute> Dim x As Integer
End Class
|
false |
|---|
Class C
<SomeAttribute>
Dim x As Integer
End Class
|
换行
硬换行于
属性名称:
最大行长度, 最大行长度
可能的值:
一个整数
将形参换行
属性名称:
参数换行样式, 参数换行样式
可能的值:
wrap_if_long:简单换行chop_if_long:如果过长或多行则分割chop_always:始终分割
示例:
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
|
chop_always |
|---|
Sub Foo(p1 As Integer,
p2 As Integer,
p3 As Integer)
End Sub
|
首选方法声明中的 '(' 前换行
属性名称:
在声明左括号前换行, 在声明左括号前换行
可能的值:
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
|
将调用实参换行
属性名称:
参数换行样式, 参数换行样式
可能的值:
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)
|
chop_always |
|---|
SomeMethod(arg1,
arg2,
arg3,
arg4,
arg5)
|
首选在调用中的 '(' 前换行
属性名称:
在调用左括号前换行, 在调用左括号前换行
可能的值:
true|false
示例:
true |
|---|
SomeMethod _
(arg1, arg2, arg3, arg4,
arg5)
|
false |
|---|
SomeMethod(arg1, arg2, arg3,
arg4, arg5)
|
将 extends/implements/handles 列表换行
属性名称:
扩展列表换行样式, 扩展列表换行样式
可能的值:
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
|
将多个声明列表换行
属性名称:
多重声明换行样式, 多重声明换行样式
可能的值:
wrap_if_long:简单换行chop_if_long:如果过长或多行则分割chop_always:始终分割
示例:
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
|
chop_always |
|---|
Class C
Dim x As Integer = 0,
y As Integer = 1,
s As String = ""
End Class
|
首选在二元表达式中的运算符前换行
属性名称:
在二元运算符前换行, 在二元运算符前换行
可能的值:
true|false
示例:
true |
|---|
myField1 = expression1 _
+ expression2 _
+ expression3 _
+ expression4 _
+ expression5
|
false |
|---|
myField1 = expression1 +
expression2 +
expression3 +
expression4 +
expression5
|