Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
8b8d4cca
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,发现更多精彩内容 >>
提交
8b8d4cca
编写于
7月 09, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify lambdas
上级
f8b1d566
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
30 addition
and
30 deletion
+30
-30
src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs
...InlineRename/InlineRenameSession.OpenTextBufferManager.cs
+1
-1
src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
...tUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
+1
-1
src/EditorFeatures/TestUtilities/QuickInfo/AbstractSemanticQuickInfoSourceTests.cs
...ilities/QuickInfo/AbstractSemanticQuickInfoSourceTests.cs
+6
-6
src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs
...table/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs
...InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs
+1
-1
src/Features/CSharp/Portable/CodeRefactorings/InvertIf/InvertIfCodeRefactoringProvider.cs
...eRefactorings/InvertIf/InvertIfCodeRefactoringProvider.cs
+1
-1
src/Features/CSharp/Portable/CodeRefactorings/LambdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
...mbdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
+4
-4
src/Features/CSharp/Portable/CodeRefactorings/MoveDeclarationNearReference/MoveDeclarationNearReferenceCodeRefactoringProvider.cs
...ce/MoveDeclarationNearReferenceCodeRefactoringProvider.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs
...on/CompletionProviders/XmlDocCommentCompletionProvider.cs
+1
-1
src/Features/CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
...CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs
...ble/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs
+1
-1
src/Features/Core/Portable/CodeRefactorings/ExtractMethod/AbstractExtractMethodCodeRefactoringProvider.cs
...actMethod/AbstractExtractMethodCodeRefactoringProvider.cs
+1
-1
src/Features/Core/Portable/ExtractMethod/MethodExtractor.VariableSymbol.cs
.../Portable/ExtractMethod/MethodExtractor.VariableSymbol.cs
+1
-1
src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs
...ble/SolutionCrawler/SolutionCrawlerRegistrationService.cs
+1
-1
src/VisualStudio/CSharp/Impl/Options/Formatting/NewLinesViewModel.cs
...tudio/CSharp/Impl/Options/Formatting/NewLinesViewModel.cs
+1
-1
src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs
...aces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs
+1
-1
src/Workspaces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
...aces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
+1
-1
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
...harpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
+1
-1
src/Workspaces/Core/Portable/Log/Logger.cs
src/Workspaces/Core/Portable/Log/Logger.cs
+1
-1
src/Workspaces/Core/Portable/Simplification/AbstractSimplificationService.cs
.../Portable/Simplification/AbstractSimplificationService.cs
+3
-3
未找到文件。
src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs
浏览文件 @
8b8d4cca
...
...
@@ -68,7 +68,7 @@ internal class OpenTextBufferManager : ForegroundThreadAffinitizedObject
session
.
UndoManager
.
CreateStartRenameUndoTransaction
(
workspace
,
subjectBuffer
,
session
);
_isBufferReadOnly
=
new
DynamicReadOnlyRegionQuery
(
(
isEdit
)
=>
!
_session
.
_isApplyingEdit
);
_isBufferReadOnly
=
new
DynamicReadOnlyRegionQuery
(
isEdit
=>
!
_session
.
_isApplyingEdit
);
UpdateReadOnlyRegions
();
}
...
...
src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
浏览文件 @
8b8d4cca
...
...
@@ -156,7 +156,7 @@ public DiagnosticAnalyzerCategory GetAnalyzerCategory()
public
override
void
Initialize
(
AnalysisContext
analysisContext
)
{
analysisContext
.
RegisterSyntaxTreeAction
(
(
context
)
=>
context
=>
{
foreach
(
var
node
in
AllNodes
)
{
...
...
src/EditorFeatures/TestUtilities/QuickInfo/AbstractSemanticQuickInfoSourceTests.cs
浏览文件 @
8b8d4cca
...
...
@@ -173,7 +173,7 @@ protected void WaitForDocumentationComment(object content)
internal
Action
<
object
>
SymbolGlyph
(
Glyph
expectedGlyph
)
{
return
(
content
)
=>
return
content
=>
{
var
actualIcon
=
((
QuickInfoDisplayDeferredContent
)
content
).
SymbolGlyph
;
Assert
.
Equal
(
expectedGlyph
,
actualIcon
.
Glyph
);
...
...
@@ -238,7 +238,7 @@ internal Action<object> SymbolGlyph(Glyph expectedGlyph)
string
expectedText
,
Tuple
<
string
,
string
>[]
expectedClassifications
=
null
)
{
return
(
content
)
=>
return
content
=>
{
var
actualContent
=
((
QuickInfoDisplayDeferredContent
)
content
).
TypeParameterMap
.
ClassifiableContent
;
...
...
@@ -255,7 +255,7 @@ internal Action<object> SymbolGlyph(Glyph expectedGlyph)
string
expectedText
,
Tuple
<
string
,
string
>[]
expectedClassifications
=
null
)
{
return
(
content
)
=>
return
content
=>
{
var
actualContent
=
((
QuickInfoDisplayDeferredContent
)
content
).
AnonymousTypes
.
ClassifiableContent
;
...
...
@@ -272,7 +272,7 @@ protected Action<object> NoTypeParameterMap
{
get
{
return
(
content
)
=>
return
content
=>
{
Assert
.
Equal
(
string
.
Empty
,
((
QuickInfoDisplayDeferredContent
)
content
).
TypeParameterMap
.
ClassifiableContent
.
GetFullText
());
};
...
...
@@ -281,7 +281,7 @@ protected Action<object> NoTypeParameterMap
protected
Action
<
object
>
Usage
(
string
expectedText
,
bool
expectsWarningGlyph
=
false
)
{
return
(
content
)
=>
return
content
=>
{
var
quickInfoContent
=
(
QuickInfoDisplayDeferredContent
)
content
;
Assert
.
Equal
(
expectedText
,
quickInfoContent
.
UsageText
.
ClassifiableContent
.
GetFullText
());
...
...
@@ -291,7 +291,7 @@ protected Action<object> Usage(string expectedText, bool expectsWarningGlyph = f
protected
Action
<
object
>
Exceptions
(
string
expectedText
)
{
return
(
content
)
=>
return
content
=>
{
var
quickInfoContent
=
(
QuickInfoDisplayDeferredContent
)
content
;
Assert
.
Equal
(
expectedText
,
quickInfoContent
.
ExceptionText
.
ClassifiableContent
.
GetFullText
());
...
...
src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -197,7 +197,7 @@ protected override bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNod
return
false
;
}
node
=
ancestors
.
FirstOrDefault
(
(
n
)
=>
n
.
Span
.
Contains
(
span
)
&&
n
!=
root
&&
n
.
IsKind
(
SyntaxKind
.
ReturnStatement
));
node
=
ancestors
.
FirstOrDefault
(
n
=>
n
.
Span
.
Contains
(
span
)
&&
n
!=
root
&&
n
.
IsKind
(
SyntaxKind
.
ReturnStatement
));
return
node
!=
null
;
}
...
...
src/Features/CSharp/Portable/CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -90,7 +90,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
context
.
RegisterRefactoring
(
new
MyCodeAction
(
CSharpFeaturesResources
.
Inline_temporary_variable
,
(
c
)
=>
this
.
InlineTemporaryAsync
(
document
,
variableDeclarator
,
c
)));
c
=>
this
.
InlineTemporaryAsync
(
document
,
variableDeclarator
,
c
)));
}
private
async
Task
<
IEnumerable
<
ReferenceLocation
>>
GetReferencesAsync
(
...
...
src/Features/CSharp/Portable/CodeRefactorings/InvertIf/InvertIfCodeRefactoringProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -66,7 +66,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
context
.
RegisterRefactoring
(
new
MyCodeAction
(
CSharpFeaturesResources
.
Invert_if_statement
,
(
c
)
=>
InvertIfAsync
(
document
,
ifStatement
,
c
)));
c
=>
InvertIfAsync
(
document
,
ifStatement
,
c
)));
}
private
async
Task
<
Document
>
InvertIfAsync
(
Document
document
,
IfStatementSyntax
ifStatement
,
CancellationToken
cancellationToken
)
...
...
src/Features/CSharp/Portable/CodeRefactorings/LambdaSimplifier/LambdaSimplifierCodeRefactoringProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -51,12 +51,12 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
context
.
RegisterRefactoring
(
new
MyCodeAction
(
CSharpFeaturesResources
.
Simplify_lambda_expression
,
(
c
)
=>
SimplifyLambdaAsync
(
document
,
lambda
,
c
)));
c
=>
SimplifyLambdaAsync
(
document
,
lambda
,
c
)));
context
.
RegisterRefactoring
(
new
MyCodeAction
(
CSharpFeaturesResources
.
Simplify_all_occurrences
,
(
c
)
=>
SimplifyAllLambdasAsync
(
document
,
c
)));
c
=>
SimplifyAllLambdasAsync
(
document
,
c
)));
}
private
async
Task
<
Document
>
SimplifyLambdaAsync
(
...
...
@@ -65,7 +65,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
CancellationToken
cancellationToken
)
{
var
semanticDocument
=
await
SemanticDocument
.
CreateAsync
(
document
,
cancellationToken
).
ConfigureAwait
(
false
);
var
rewriter
=
new
Rewriter
(
this
,
semanticDocument
,
(
n
)
=>
n
==
lambda
,
cancellationToken
);
var
rewriter
=
new
Rewriter
(
this
,
semanticDocument
,
n
=>
n
==
lambda
,
cancellationToken
);
var
result
=
rewriter
.
Visit
(
semanticDocument
.
Root
);
return
document
.
WithSyntaxRoot
(
result
);
}
...
...
@@ -75,7 +75,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
CancellationToken
cancellationToken
)
{
var
semanticDocument
=
await
SemanticDocument
.
CreateAsync
(
document
,
cancellationToken
).
ConfigureAwait
(
false
);
var
rewriter
=
new
Rewriter
(
this
,
semanticDocument
,
(
n
)
=>
true
,
cancellationToken
);
var
rewriter
=
new
Rewriter
(
this
,
semanticDocument
,
n
=>
true
,
cancellationToken
);
var
result
=
rewriter
.
Visit
(
semanticDocument
.
Root
);
return
document
.
WithSyntaxRoot
(
result
);
}
...
...
src/Features/CSharp/Portable/CodeRefactorings/MoveDeclarationNearReference/MoveDeclarationNearReferenceCodeRefactoringProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -54,7 +54,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
context
.
RegisterRefactoring
(
new
MyCodeAction
(
CSharpFeaturesResources
.
Move_declaration_near_reference
,
(
c
)
=>
MoveDeclarationNearReferenceAsync
(
document
,
state
,
c
)));
c
=>
MoveDeclarationNearReferenceAsync
(
document
,
state
,
c
)));
}
private
async
Task
<
Document
>
MoveDeclarationNearReferenceAsync
(
Document
document
,
State
state
,
CancellationToken
cancellationToken
)
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -146,7 +146,7 @@ private IEnumerable<CompletionItem> GetTopLevelSingleUseNames(DocumentationComme
{
var
names
=
new
HashSet
<
string
>(
new
[]
{
SummaryTagName
,
RemarksTagName
,
ExampleTagName
,
CompletionListTagName
});
RemoveExistingTags
(
parentTrivia
,
names
,
(
x
)
=>
x
.
StartTag
.
Name
.
LocalName
.
ValueText
);
RemoveExistingTags
(
parentTrivia
,
names
,
x
=>
x
.
StartTag
.
Name
.
LocalName
.
ValueText
);
return
names
.
Select
(
GetItem
);
}
...
...
src/Features/CSharp/Portable/GenerateType/CSharpGenerateTypeService.cs
浏览文件 @
8b8d4cca
...
...
@@ -357,7 +357,7 @@ protected override bool TryGetNameParts(ExpressionSyntax expression, out IList<s
outerMostMemberAccessExpression
=
(
ExpressionSyntax
)
nameOrMemberAccessExpression
.
Parent
;
}
outerMostMemberAccessExpression
=
outerMostMemberAccessExpression
.
GetAncestorsOrThis
<
ExpressionSyntax
>().
SkipWhile
(
(
n
)
=>
n
!=
null
&&
n
.
IsKind
(
SyntaxKind
.
SimpleMemberAccessExpression
)).
FirstOrDefault
();
outerMostMemberAccessExpression
=
outerMostMemberAccessExpression
.
GetAncestorsOrThis
<
ExpressionSyntax
>().
SkipWhile
(
n
=>
n
!=
null
&&
n
.
IsKind
(
SyntaxKind
.
SimpleMemberAccessExpression
)).
FirstOrDefault
();
if
(
outerMostMemberAccessExpression
!=
null
&&
outerMostMemberAccessExpression
is
InvocationExpressionSyntax
)
{
generateTypeServiceStateOptions
.
IsEnumNotAllowed
=
true
;
...
...
src/Features/Core/Portable/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -40,7 +40,7 @@ protected virtual bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode
return
false
;
}
node
=
ancestors
.
FirstOrDefault
(
(
n
)
=>
n
.
Span
.
Contains
(
span
)
&&
n
!=
root
);
node
=
ancestors
.
FirstOrDefault
(
n
=>
n
.
Span
.
Contains
(
span
)
&&
n
!=
root
);
return
node
!=
null
;
}
}
...
...
src/Features/Core/Portable/CodeRefactorings/ExtractMethod/AbstractExtractMethodCodeRefactoringProvider.cs
浏览文件 @
8b8d4cca
...
...
@@ -70,7 +70,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
var
description
=
documentOptions
.
GetOption
(
ExtractMethodOptions
.
AllowMovingDeclaration
)
?
FeaturesResources
.
Extract_Method_plus_Local
:
FeaturesResources
.
Extract_Method
;
var
codeAction
=
new
MyCodeAction
(
description
,
(
c
)
=>
AddRenameAnnotationAsync
(
result
.
Document
,
result
.
InvocationNameToken
,
c
));
var
codeAction
=
new
MyCodeAction
(
description
,
c
=>
AddRenameAnnotationAsync
(
result
.
Document
,
result
.
InvocationNameToken
,
c
));
var
methodBlock
=
result
.
MethodDeclarationNode
;
return
Tuple
.
Create
<
CodeAction
,
string
>(
codeAction
,
methodBlock
.
ToString
());
...
...
src/Features/Core/Portable/ExtractMethod/MethodExtractor.VariableSymbol.cs
浏览文件 @
8b8d4cca
...
...
@@ -275,7 +275,7 @@ public override bool GetUseSaferDeclarationBehavior(CancellationToken cancellati
return
true
;
}
var
declStatement
=
identifier
.
Parent
.
FirstAncestorOrSelf
<
T
>(
(
n
)
=>
true
);
var
declStatement
=
identifier
.
Parent
.
FirstAncestorOrSelf
<
T
>(
n
=>
true
);
if
(
declStatement
==
null
)
{
return
true
;
...
...
src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs
浏览文件 @
8b8d4cca
...
...
@@ -93,7 +93,7 @@ public void AddAnalyzerProvider(IIncrementalAnalyzerProvider provider, Increment
var
lazyProvider
=
new
Lazy
<
IIncrementalAnalyzerProvider
,
IncrementalAnalyzerProviderMetadata
>(()
=>
provider
,
metadata
);
// update existing map for future solution crawler registration - no need for interlock but this makes add or update easier
ImmutableInterlocked
.
AddOrUpdate
(
ref
_analyzerProviders
,
metadata
.
Name
,
(
n
)
=>
ImmutableArray
.
Create
(
lazyProvider
),
(
n
,
v
)
=>
v
.
Add
(
lazyProvider
));
ImmutableInterlocked
.
AddOrUpdate
(
ref
_analyzerProviders
,
metadata
.
Name
,
n
=>
ImmutableArray
.
Create
(
lazyProvider
),
(
n
,
v
)
=>
v
.
Add
(
lazyProvider
));
// assert map integrity
AssertAnalyzerProviders
(
_analyzerProviders
);
...
...
src/VisualStudio/CSharp/Impl/Options/Formatting/NewLinesViewModel.cs
浏览文件 @
8b8d4cca
...
...
@@ -82,7 +82,7 @@ class C {
class C {
void Foo() {
//[
Func<int, int> f =
(x)
=> {
Func<int, int> f =
x
=> {
return 2 * x;
};
//]
...
...
src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs
浏览文件 @
8b8d4cca
...
...
@@ -23,7 +23,7 @@ internal static class AttributeGenerator
{
if
(
options
.
MergeAttributes
)
{
var
attributeNodes
=
attributes
.
OrderBy
(
a
=>
a
.
AttributeClass
.
Name
).
Select
(
(
a
)
=>
GenerateAttribute
(
a
,
options
)).
WhereNotNull
().
ToList
();
var
attributeNodes
=
attributes
.
OrderBy
(
a
=>
a
.
AttributeClass
.
Name
).
Select
(
a
=>
GenerateAttribute
(
a
,
options
)).
WhereNotNull
().
ToList
();
return
attributeNodes
.
Count
==
0
?
default
(
SyntaxList
<
AttributeListSyntax
>)
:
SyntaxFactory
.
SingletonList
(
SyntaxFactory
.
AttributeList
(
...
...
src/Workspaces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
浏览文件 @
8b8d4cca
...
...
@@ -144,7 +144,7 @@ public static string AsString(this IEnumerable<SyntaxTrivia> trivia)
if
(
trivia
.
Any
())
{
var
sb
=
new
StringBuilder
();
trivia
.
Select
(
t
=>
t
.
ToFullString
()).
Do
(
(
s
)
=>
sb
.
Append
(
s
));
trivia
.
Select
(
t
=>
t
.
ToFullString
()).
Do
(
s
=>
sb
.
Append
(
s
));
return
sb
.
ToString
();
}
else
...
...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
浏览文件 @
8b8d4cca
...
...
@@ -93,7 +93,7 @@ private SyntaxNode GetNodeInStructuredTrivia(SyntaxNode parent)
// Syntax references to nonterminals in structured trivia should be uncommon.
// Provide more efficient implementation if that is not true
var
descendantsIntersectingSpan
=
parent
.
DescendantNodes
(
_textSpan
,
descendIntoTrivia
:
true
);
return
descendantsIntersectingSpan
.
First
(
(
node
)
=>
node
.
IsKind
(
_kind
)
&&
node
.
Span
==
_textSpan
);
return
descendantsIntersectingSpan
.
First
(
node
=>
node
.
IsKind
(
_kind
)
&&
node
.
Span
==
_textSpan
);
}
}
}
...
...
src/Workspaces/Core/Portable/Log/Logger.cs
浏览文件 @
8b8d4cca
...
...
@@ -345,7 +345,7 @@ public static IDisposable LogBlock(FunctionId functionId, LogMessage logMessage,
var
functionIds
=
Enum
.
GetValues
(
typeof
(
FunctionId
)).
Cast
<
FunctionId
>();
var
functionIdOptions
=
functionIds
.
ToDictionary
(
id
=>
id
,
id
=>
optionService
.
GetOption
(
FunctionIdOptions
.
GetOption
(
id
)));
return
(
functionId
)
=>
functionIdOptions
[
functionId
];
return
functionId
=>
functionIdOptions
[
functionId
];
}
}
}
src/Workspaces/Core/Portable/Simplification/AbstractSimplificationService.cs
浏览文件 @
8b8d4cca
...
...
@@ -98,7 +98,7 @@ protected virtual SyntaxNode TransformReducedNode(SyntaxNode reducedNode, Syntax
// Create a simple interval tree for simplification spans.
var
spansTree
=
new
SimpleIntervalTree
<
TextSpan
>(
TextSpanIntervalIntrospector
.
Instance
,
spans
);
Func
<
SyntaxNodeOrToken
,
bool
>
isNodeOrTokenOutsideSimplifySpans
=
(
nodeOrToken
)
=>
Func
<
SyntaxNodeOrToken
,
bool
>
isNodeOrTokenOutsideSimplifySpans
=
nodeOrToken
=>
!
spansTree
.
HasIntervalThatOverlapsWith
(
nodeOrToken
.
FullSpan
.
Start
,
nodeOrToken
.
FullSpan
.
Length
);
var
semanticModel
=
await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
...
...
@@ -219,7 +219,7 @@ protected virtual SyntaxNode TransformReducedNode(SyntaxNode reducedNode, Syntax
currentNodeOrToken
=
replacedParent
.
ChildNodesAndTokens
()
.
Single
(
(
c
)
=>
c
.
HasAnnotation
(
annotation
));
.
Single
(
c
=>
c
.
HasAnnotation
(
annotation
));
}
if
(
isNode
)
...
...
@@ -233,7 +233,7 @@ protected virtual SyntaxNode TransformReducedNode(SyntaxNode reducedNode, Syntax
var
newDocument
=
document
.
WithSyntaxRoot
(
newRoot
);
semanticModelForReduce
=
await
newDocument
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
newRoot
=
await
semanticModelForReduce
.
SyntaxTree
.
GetRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
currentNodeOrToken
=
newRoot
.
DescendantNodes
().
Single
(
(
c
)
=>
c
.
HasAnnotation
(
marker
));
currentNodeOrToken
=
newRoot
.
DescendantNodes
().
Single
(
c
=>
c
.
HasAnnotation
(
marker
));
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录