Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
4a180e39
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a180e39
编写于
4月 13, 2020
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid passing options to AddAnchorIndentationOperations
上级
8df8f936
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
20 addition
and
28 deletion
+20
-28
src/EditorFeatures/VisualBasic/LineCommit/CommitFormatter.vb
src/EditorFeatures/VisualBasic/LineCommit/CommitFormatter.vb
+1
-1
src/Features/CSharp/Portable/ExtractMethod/CSharpMethodExtractor.FormattingProvider.cs
...ExtractMethod/CSharpMethodExtractor.FormattingProvider.cs
+1
-1
src/Features/CSharp/Portable/MetadataAsSource/CSharpMetadataAsSourceService.cs
...ortable/MetadataAsSource/CSharpMetadataAsSourceService.cs
+1
-2
src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService+CompatAbstractMetadataFormattingRule.cs
...taAsSourceService+CompatAbstractMetadataFormattingRule.cs
+4
-4
src/Features/VisualBasic/Portable/MetadataAsSource/VisualBasicMetadataAsSourceService.vb
...le/MetadataAsSource/VisualBasicMetadataAsSourceService.vb
+1
-2
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/DefaultOperationProvider.cs
...ns/Compiler/CSharp/Formatting/DefaultOperationProvider.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/AnchorIndentationFormattingRule.cs
...Sharp/Formatting/Rules/AnchorIndentationFormattingRule.cs
+1
-2
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/QueryExpressionFormattingRule.cs
.../CSharp/Formatting/Rules/QueryExpressionFormattingRule.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Engine/ChainedFormattingRules.cs
...Compiler/Core/Formatting/Engine/ChainedFormattingRules.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/AbstractFormattingRule.cs
.../Compiler/Core/Formatting/Rules/AbstractFormattingRule.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
...ler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
+4
-4
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/NextAnchorIndentationOperationAction.cs
.../Formatting/Rules/NextAnchorIndentationOperationAction.cs
+2
-6
src/Workspaces/VisualBasic/Portable/Formatting/DefaultOperationProvider.vb
...sualBasic/Portable/Formatting/DefaultOperationProvider.vb
+1
-1
src/Workspaces/VisualBasic/Portable/Formatting/Rules/NodeBasedFormattingRule.vb
...asic/Portable/Formatting/Rules/NodeBasedFormattingRule.vb
+0
-1
未找到文件。
src/EditorFeatures/VisualBasic/LineCommit/CommitFormatter.vb
浏览文件 @
4a180e39
...
@@ -269,7 +269,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
...
@@ -269,7 +269,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
Private
Class
NoAnchorFormatterRule
Private
Class
NoAnchorFormatterRule
Inherits
CompatAbstractFormattingRule
Inherits
CompatAbstractFormattingRule
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
list
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
list
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
' no anchor/relative formatting
' no anchor/relative formatting
Return
Return
End
Sub
End
Sub
...
...
src/Features/CSharp/Portable/ExtractMethod/CSharpMethodExtractor.FormattingProvider.cs
浏览文件 @
4a180e39
...
@@ -55,7 +55,7 @@ public override AdjustNewLinesOperation GetAdjustNewLinesOperation(SyntaxToken p
...
@@ -55,7 +55,7 @@ public override AdjustNewLinesOperation GetAdjustNewLinesOperation(SyntaxToken p
return
operation
;
return
operation
;
}
}
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
if
(
node
.
IsKind
(
SyntaxKind
.
SimpleLambdaExpression
)
||
node
.
IsKind
(
SyntaxKind
.
ParenthesizedLambdaExpression
)
||
node
.
IsKind
(
SyntaxKind
.
AnonymousMethodExpression
))
if
(
node
.
IsKind
(
SyntaxKind
.
SimpleLambdaExpression
)
||
node
.
IsKind
(
SyntaxKind
.
ParenthesizedLambdaExpression
)
||
node
.
IsKind
(
SyntaxKind
.
AnonymousMethodExpression
))
{
{
...
...
src/Features/CSharp/Portable/MetadataAsSource/CSharpMetadataAsSourceService.cs
浏览文件 @
4a180e39
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
using
Microsoft.CodeAnalysis.CSharp.DocumentationComments
;
using
Microsoft.CodeAnalysis.CSharp.DocumentationComments
;
using
Microsoft.CodeAnalysis.CSharp.Simplification
;
using
Microsoft.CodeAnalysis.CSharp.Simplification
;
using
Microsoft.CodeAnalysis.CSharp.Utilities
;
using
Microsoft.CodeAnalysis.CSharp.Utilities
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.DocumentationComments
;
using
Microsoft.CodeAnalysis.DocumentationComments
;
using
Microsoft.CodeAnalysis.Formatting
;
using
Microsoft.CodeAnalysis.Formatting
;
using
Microsoft.CodeAnalysis.Formatting.Rules
;
using
Microsoft.CodeAnalysis.Formatting.Rules
;
...
@@ -115,7 +114,7 @@ protected override AdjustNewLinesOperation GetAdjustNewLinesOperationBetweenMemb
...
@@ -115,7 +114,7 @@ protected override AdjustNewLinesOperation GetAdjustNewLinesOperationBetweenMemb
return
FormattingOperations
.
CreateAdjustNewLinesOperation
(
GetNumberOfLines
(
triviaList
)
+
1
,
AdjustNewLinesOption
.
ForceLines
);
return
FormattingOperations
.
CreateAdjustNewLinesOperation
(
GetNumberOfLines
(
triviaList
)
+
1
,
AdjustNewLinesOption
.
ForceLines
);
}
}
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
return
;
return
;
}
}
...
...
src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService+CompatAbstractMetadataFormattingRule.cs
浏览文件 @
4a180e39
...
@@ -25,10 +25,10 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
...
@@ -25,10 +25,10 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
var
nextOperationCopy
=
nextOperation
;
var
nextOperationCopy
=
nextOperation
;
AddAnchorIndentationOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
AddAnchorIndentationOperationsSlow
(
list
,
node
,
ref
nextOperationCopy
);
}
}
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
...
@@ -74,8 +74,8 @@ public virtual void AddSuppressOperationsSlow(List<SuppressOperation> list, Synt
...
@@ -74,8 +74,8 @@ public virtual void AddSuppressOperationsSlow(List<SuppressOperation> list, Synt
/// <summary>
/// <summary>
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// </summary>
/// </summary>
public
virtual
void
AddAnchorIndentationOperationsSlow
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
ref
NextAnchorIndentationOperationAction
nextOperation
)
public
virtual
void
AddAnchorIndentationOperationsSlow
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
ref
NextAnchorIndentationOperationAction
nextOperation
)
=>
base
.
AddAnchorIndentationOperations
(
list
,
node
,
options
,
in
nextOperation
);
=>
base
.
AddAnchorIndentationOperations
(
list
,
node
,
in
nextOperation
);
/// <summary>
/// <summary>
/// returns IndentBlockOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// returns IndentBlockOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
...
...
src/Features/VisualBasic/Portable/MetadataAsSource/VisualBasicMetadataAsSourceService.vb
浏览文件 @
4a180e39
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
Imports
System.Collections.Immutable
Imports
System.Collections.Immutable
Imports
System.Threading
Imports
System.Threading
Imports
Microsoft.CodeAnalysis.CodeGeneration
Imports
Microsoft.CodeAnalysis.CodeGeneration
Imports
Microsoft.CodeAnalysis.Diagnostics
Imports
Microsoft.CodeAnalysis.DocumentationComments
Imports
Microsoft.CodeAnalysis.DocumentationComments
Imports
Microsoft.CodeAnalysis.Formatting
Imports
Microsoft.CodeAnalysis.Formatting
Imports
Microsoft.CodeAnalysis.Formatting.Rules
Imports
Microsoft.CodeAnalysis.Formatting.Rules
...
@@ -108,7 +107,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.MetadataAsSource
...
@@ -108,7 +107,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.MetadataAsSource
Return
FormattingOperations
.
CreateAdjustNewLinesOperation
(
GetNumberOfLines
(
triviaList
)
+
1
,
AdjustNewLinesOption
.
ForceLines
)
Return
FormattingOperations
.
CreateAdjustNewLinesOperation
(
GetNumberOfLines
(
triviaList
)
+
1
,
AdjustNewLinesOption
.
ForceLines
)
End
Function
End
Function
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
list
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
list
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
Return
Return
End
Sub
End
Sub
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/DefaultOperationProvider.cs
浏览文件 @
4a180e39
...
@@ -26,7 +26,7 @@ public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxN
...
@@ -26,7 +26,7 @@ public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxN
{
{
}
}
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
}
}
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/AnchorIndentationFormattingRule.cs
浏览文件 @
4a180e39
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Formatting.Rules
;
using
Microsoft.CodeAnalysis.Formatting.Rules
;
namespace
Microsoft.CodeAnalysis.CSharp.Formatting
namespace
Microsoft.CodeAnalysis.CSharp.Formatting
...
@@ -15,7 +14,7 @@ internal class AnchorIndentationFormattingRule : BaseFormattingRule
...
@@ -15,7 +14,7 @@ internal class AnchorIndentationFormattingRule : BaseFormattingRule
{
{
internal
const
string
Name
=
"CSharp Anchor Indentation Formatting Rule"
;
internal
const
string
Name
=
"CSharp Anchor Indentation Formatting Rule"
;
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
nextOperation
.
Invoke
();
nextOperation
.
Invoke
();
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/QueryExpressionFormattingRule.cs
浏览文件 @
4a180e39
...
@@ -84,7 +84,7 @@ public override void AddIndentBlockOperations(List<IndentBlockOperation> list, S
...
@@ -84,7 +84,7 @@ public override void AddIndentBlockOperations(List<IndentBlockOperation> list, S
}
}
}
}
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
nextOperation
.
Invoke
();
nextOperation
.
Invoke
();
switch
(
node
)
switch
(
node
)
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Engine/ChainedFormattingRules.cs
浏览文件 @
4a180e39
...
@@ -54,7 +54,7 @@ public void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode curre
...
@@ -54,7 +54,7 @@ public void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode curre
public
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
currentNode
)
public
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
currentNode
)
{
{
var
action
=
new
NextAnchorIndentationOperationAction
(
_addAnchorIndentationOperationsRules
,
index
:
0
,
currentNode
,
_options
,
list
);
var
action
=
new
NextAnchorIndentationOperationAction
(
_addAnchorIndentationOperationsRules
,
index
:
0
,
currentNode
,
list
);
action
.
Invoke
();
action
.
Invoke
();
}
}
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/AbstractFormattingRule.cs
浏览文件 @
4a180e39
...
@@ -28,7 +28,7 @@ public virtual void AddSuppressOperations(List<SuppressOperation> list, SyntaxNo
...
@@ -28,7 +28,7 @@ public virtual void AddSuppressOperations(List<SuppressOperation> list, SyntaxNo
/// <summary>
/// <summary>
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// </summary>
/// </summary>
public
virtual
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
virtual
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
=>
nextOperation
.
Invoke
();
=>
nextOperation
.
Invoke
();
/// <summary>
/// <summary>
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
浏览文件 @
4a180e39
...
@@ -24,10 +24,10 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
...
@@ -24,10 +24,10 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
{
var
nextOperationCopy
=
nextOperation
;
var
nextOperationCopy
=
nextOperation
;
AddAnchorIndentationOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
AddAnchorIndentationOperationsSlow
(
list
,
node
,
ref
nextOperationCopy
);
}
}
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
...
@@ -73,8 +73,8 @@ public virtual void AddSuppressOperationsSlow(List<SuppressOperation> list, Synt
...
@@ -73,8 +73,8 @@ public virtual void AddSuppressOperationsSlow(List<SuppressOperation> list, Synt
/// <summary>
/// <summary>
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// returns AnchorIndentationOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// </summary>
/// </summary>
public
virtual
void
AddAnchorIndentationOperationsSlow
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
ref
NextAnchorIndentationOperationAction
nextOperation
)
public
virtual
void
AddAnchorIndentationOperationsSlow
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
ref
NextAnchorIndentationOperationAction
nextOperation
)
=>
base
.
AddAnchorIndentationOperations
(
list
,
node
,
options
,
in
nextOperation
);
=>
base
.
AddAnchorIndentationOperations
(
list
,
node
,
in
nextOperation
);
/// <summary>
/// <summary>
/// returns IndentBlockOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
/// returns IndentBlockOperations under a node either by itself or by filtering/replacing operations returned by NextOperation
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/NextAnchorIndentationOperationAction.cs
浏览文件 @
4a180e39
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Roslyn.Utilities
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Formatting.Rules
namespace
Microsoft.CodeAnalysis.Formatting.Rules
...
@@ -17,25 +16,22 @@ namespace Microsoft.CodeAnalysis.Formatting.Rules
...
@@ -17,25 +16,22 @@ namespace Microsoft.CodeAnalysis.Formatting.Rules
private
readonly
ImmutableArray
<
AbstractFormattingRule
>
_formattingRules
;
private
readonly
ImmutableArray
<
AbstractFormattingRule
>
_formattingRules
;
private
readonly
int
_index
;
private
readonly
int
_index
;
private
readonly
SyntaxNode
_node
;
private
readonly
SyntaxNode
_node
;
private
readonly
AnalyzerConfigOptions
_options
;
private
readonly
List
<
AnchorIndentationOperation
>
_list
;
private
readonly
List
<
AnchorIndentationOperation
>
_list
;
public
NextAnchorIndentationOperationAction
(
public
NextAnchorIndentationOperationAction
(
ImmutableArray
<
AbstractFormattingRule
>
formattingRules
,
ImmutableArray
<
AbstractFormattingRule
>
formattingRules
,
int
index
,
int
index
,
SyntaxNode
node
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
List
<
AnchorIndentationOperation
>
list
)
List
<
AnchorIndentationOperation
>
list
)
{
{
_formattingRules
=
formattingRules
;
_formattingRules
=
formattingRules
;
_index
=
index
;
_index
=
index
;
_node
=
node
;
_node
=
node
;
_options
=
options
;
_list
=
list
;
_list
=
list
;
}
}
private
NextAnchorIndentationOperationAction
NextAction
private
NextAnchorIndentationOperationAction
NextAction
=>
new
NextAnchorIndentationOperationAction
(
_formattingRules
,
_index
+
1
,
_node
,
_
options
,
_
list
);
=>
new
NextAnchorIndentationOperationAction
(
_formattingRules
,
_index
+
1
,
_node
,
_list
);
public
void
Invoke
()
public
void
Invoke
()
{
{
...
@@ -47,7 +43,7 @@ public void Invoke()
...
@@ -47,7 +43,7 @@ public void Invoke()
else
else
{
{
// Call the handler at the index, passing a continuation that will come back to here with index + 1
// Call the handler at the index, passing a continuation that will come back to here with index + 1
_formattingRules
[
_index
].
AddAnchorIndentationOperations
(
_list
,
_node
,
_options
,
NextAction
);
_formattingRules
[
_index
].
AddAnchorIndentationOperations
(
_list
,
_node
,
NextAction
);
return
;
return
;
}
}
}
}
...
...
src/Workspaces/VisualBasic/Portable/Formatting/DefaultOperationProvider.vb
浏览文件 @
4a180e39
...
@@ -25,7 +25,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting
...
@@ -25,7 +25,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting
Public
Overrides
Sub
AddSuppressOperationsSlow
(
operations
As
List
(
Of
SuppressOperation
),
node
As
SyntaxNode
,
ByRef
nextAction
As
NextSuppressOperationAction
)
Public
Overrides
Sub
AddSuppressOperationsSlow
(
operations
As
List
(
Of
SuppressOperation
),
node
As
SyntaxNode
,
ByRef
nextAction
As
NextSuppressOperationAction
)
End
Sub
End
Sub
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
operations
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextAction
As
NextAnchorIndentationOperationAction
)
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
operations
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
ByRef
nextAction
As
NextAnchorIndentationOperationAction
)
End
Sub
End
Sub
Public
Overrides
Sub
AddIndentBlockOperationsSlow
(
operations
As
List
(
Of
IndentBlockOperation
),
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextAction
As
NextIndentBlockOperationAction
)
Public
Overrides
Sub
AddIndentBlockOperationsSlow
(
operations
As
List
(
Of
IndentBlockOperation
),
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextAction
As
NextIndentBlockOperationAction
)
...
...
src/Workspaces/VisualBasic/Portable/Formatting/Rules/NodeBasedFormattingRule.vb
浏览文件 @
4a180e39
...
@@ -15,7 +15,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting
...
@@ -15,7 +15,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
operations
As
List
(
Of
AnchorIndentationOperation
),
Public
Overrides
Sub
AddAnchorIndentationOperationsSlow
(
operations
As
List
(
Of
AnchorIndentationOperation
),
node
As
SyntaxNode
,
node
As
SyntaxNode
,
options
As
AnalyzerConfigOptions
,
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
ByRef
nextOperation
As
NextAnchorIndentationOperationAction
)
nextOperation
.
Invoke
()
nextOperation
.
Invoke
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录