Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a037aede
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,发现更多精彩内容 >>
提交
a037aede
编写于
3月 16, 2015
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename SyntaxUtilities to LambdaUtilities
上级
4579de38
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
82 addition
and
88 deletion
+82
-88
src/Compilers/CSharp/Portable/Binder/Binder_Query.cs
src/Compilers/CSharp/Portable/Binder/Binder_Query.cs
+2
-2
src/Compilers/CSharp/Portable/BoundTree/UnboundLambda.cs
src/Compilers/CSharp/Portable/BoundTree/UnboundLambda.cs
+1
-1
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
+2
-2
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaFrame.cs
...rs/CSharp/Portable/Lowering/LambdaRewriter/LambdaFrame.cs
+1
-1
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
...CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxNode.cs
src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxNode.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/LambdaUtilities.cs
src/Compilers/CSharp/Portable/Syntax/LambdaUtilities.cs
+1
-1
src/Compilers/CSharp/Portable/Syntax/SyntaxFacts.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxFacts.cs
+1
-1
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
+1
-1
src/Compilers/VisualBasic/Portable/Binding/Binder_Query.vb
src/Compilers/VisualBasic/Portable/Binding/Binder_Query.vb
+20
-20
src/Compilers/VisualBasic/Portable/BoundTree/BoundLambda.vb
src/Compilers/VisualBasic/Portable/BoundTree/BoundLambda.vb
+2
-2
src/Compilers/VisualBasic/Portable/Lowering/LambdaRewriter/LambdaFrame.vb
...sualBasic/Portable/Lowering/LambdaRewriter/LambdaFrame.vb
+1
-1
src/Compilers/VisualBasic/Portable/Lowering/LambdaRewriter/LambdaRewriter.vb
...lBasic/Portable/Lowering/LambdaRewriter/LambdaRewriter.vb
+3
-3
src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb
src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb
+1
-1
src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb
...lers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb
+2
-2
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueClosureTests.vb
...VisualBasic/Test/Emit/Emit/EditAndContinueClosureTests.vb
+2
-2
src/Features/CSharp/CSharpFeatures.csproj
src/Features/CSharp/CSharpFeatures.csproj
+2
-2
src/Features/CSharp/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
...s/CSharp/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
+10
-11
src/Features/CSharp/EditAndContinue/StatementSyntaxComparer.cs
...eatures/CSharp/EditAndContinue/StatementSyntaxComparer.cs
+4
-5
src/Features/CSharp/EditAndContinue/SyntaxUtilities.cs
src/Features/CSharp/EditAndContinue/SyntaxUtilities.cs
+1
-2
src/Features/VisualBasic/BasicFeatures.vbproj
src/Features/VisualBasic/BasicFeatures.vbproj
+2
-2
src/Features/VisualBasic/EditAndContinue/StatementSyntaxComparer.vb
...es/VisualBasic/EditAndContinue/StatementSyntaxComparer.vb
+6
-7
src/Features/VisualBasic/EditAndContinue/SyntaxUtilities.vb
src/Features/VisualBasic/EditAndContinue/SyntaxUtilities.vb
+2
-3
src/Features/VisualBasic/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb
...sic/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb
+11
-12
未找到文件。
src/Compilers/CSharp/Portable/Binder/Binder_Query.cs
浏览文件 @
a037aede
...
...
@@ -522,7 +522,7 @@ private static BoundExpression ExtractCastInvocation(BoundCall invocation)
private
UnboundLambda
MakePairLambda
(
CSharpSyntaxNode
node
,
QueryTranslationState
state
,
RangeVariableSymbol
x1
,
RangeVariableSymbol
x2
)
{
Debug
.
Assert
(
Syntax
Utilities
.
IsQueryPairLambda
(
node
));
Debug
.
Assert
(
Lambda
Utilities
.
IsQueryPairLambda
(
node
));
LambdaBodyFactory
bodyFactory
=
(
LambdaSymbol
lambdaSymbol
,
ref
Binder
lambdaBodyBinder
,
DiagnosticBag
d
)
=>
{
...
...
@@ -683,7 +683,7 @@ private UnboundLambda MakeQueryUnboundLambda(RangeVariableMap qvm, ImmutableArra
private
UnboundLambda
MakeQueryUnboundLambda
(
CSharpSyntaxNode
node
,
QueryUnboundLambdaState
state
)
{
Debug
.
Assert
(
node
is
ExpressionSyntax
||
Syntax
Utilities
.
IsQueryPairLambda
(
node
));
Debug
.
Assert
(
node
is
ExpressionSyntax
||
Lambda
Utilities
.
IsQueryPairLambda
(
node
));
var
lambda
=
new
UnboundLambda
(
node
,
state
,
hasErrors
:
false
)
{
WasCompilerGenerated
=
true
};
state
.
SetUnboundLambda
(
lambda
);
return
lambda
;
...
...
src/Compilers/CSharp/Portable/BoundTree/UnboundLambda.cs
浏览文件 @
a037aede
...
...
@@ -49,7 +49,7 @@ public BoundLambda(CSharpSyntaxNode syntax, BoundBlock body, ImmutableArray<Diag
Debug
.
Assert
(
syntax
.
IsAnonymousFunction
()
||
// lambda expressions
syntax
is
ExpressionSyntax
&&
SyntaxFacts
.
IsLambdaBody
(
syntax
)
||
// query lambdas
Syntax
Utilities
.
IsQueryPairLambda
(
syntax
)
// "pair" lambdas in queries
Lambda
Utilities
.
IsQueryPairLambda
(
syntax
)
// "pair" lambdas in queries
);
}
...
...
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
浏览文件 @
a037aede
...
...
@@ -790,7 +790,7 @@
<Compile
Include=
"Syntax\SyntaxEquivalence.cs"
/>
<Compile
Include=
"Syntax\SyntaxExtensions.cs"
/>
<Compile
Include=
"Syntax\SyntaxFactory.cs"
/>
<Compile
Include=
"Syntax\
Syntax
Utilities.cs"
/>
<Compile
Include=
"Syntax\
Lambda
Utilities.cs"
/>
<Compile
Include=
"Syntax\SyntaxFormatter.cs"
/>
<Compile
Include=
"Syntax\SyntaxKind.cs"
/>
<Compile
Include=
"Syntax\SyntaxKindEqualityComparer.cs"
/>
...
...
@@ -893,4 +893,4 @@
<Import
Project=
"..\..\..\..\build\VSL.Imports.Closed.targets"
/>
<Import
Project=
"$(SolutionDir)\.nuget\NuGet.targets"
Condition=
"Exists('$(SolutionDir)\.nuget\NuGet.targets')"
/>
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaFrame.cs
浏览文件 @
a037aede
...
...
@@ -82,7 +82,7 @@ private static void AssertIsClosureScopeSyntax(CSharpSyntaxNode syntaxOpt)
return
;
}
if
(
Syntax
Utilities
.
IsClosureScope
(
syntaxOpt
))
if
(
Lambda
Utilities
.
IsClosureScope
(
syntaxOpt
))
{
return
;
}
...
...
src/Compilers/CSharp/Portable/Lowering/LambdaRewriter/LambdaRewriter.cs
浏览文件 @
a037aede
...
...
@@ -924,7 +924,7 @@ private void GetLambdaId(SyntaxNode syntax, ClosureKind closureKind, int closure
lambdaOrLambdaBodySyntax
=
anonymousFunction
.
Body
;
isLambdaBody
=
true
;
}
else
if
(
Syntax
Utilities
.
IsQueryPairLambda
(
syntax
))
else
if
(
Lambda
Utilities
.
IsQueryPairLambda
(
syntax
))
{
// "pair" query lambdas
lambdaOrLambdaBodySyntax
=
syntax
;
...
...
@@ -938,7 +938,7 @@ private void GetLambdaId(SyntaxNode syntax, ClosureKind closureKind, int closure
isLambdaBody
=
true
;
}
Debug
.
Assert
(!
isLambdaBody
||
Syntax
Utilities
.
IsLambdaBody
(
lambdaOrLambdaBodySyntax
));
Debug
.
Assert
(!
isLambdaBody
||
Lambda
Utilities
.
IsLambdaBody
(
lambdaOrLambdaBodySyntax
));
// determine lambda ordinal and calculate syntax offset:
lambdaOrdinal
=
_lambdaDebugInfoBuilder
.
Count
;
...
...
src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxNode.cs
浏览文件 @
a037aede
...
...
@@ -443,12 +443,12 @@ public new IEnumerable<Diagnostic> GetDiagnostics()
internal
sealed
override
SyntaxNode
GetCorrespondingLambdaBody
(
SyntaxNode
body
)
{
return
Syntax
Utilities
.
GetCorrespondingLambdaBody
(
body
,
this
);
return
Lambda
Utilities
.
GetCorrespondingLambdaBody
(
body
,
this
);
}
internal
override
SyntaxNode
GetLambda
()
{
return
Syntax
Utilities
.
GetLambda
(
this
);
return
Lambda
Utilities
.
GetLambda
(
this
);
}
#
region
Directives
...
...
src/Compilers/CSharp/Portable/Syntax/
Syntax
Utilities.cs
→
src/Compilers/CSharp/Portable/Syntax/
Lambda
Utilities.cs
浏览文件 @
a037aede
...
...
@@ -6,7 +6,7 @@
namespace
Microsoft.CodeAnalysis.CSharp
{
internal
partial
class
Syntax
Utilities
internal
static
class
Lambda
Utilities
{
/// <summary>
/// Returns true if the specified node represents a lambda.
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxFacts.cs
浏览文件 @
a037aede
...
...
@@ -371,7 +371,7 @@ internal static bool IsStatementExpression(CSharpSyntaxNode syntax)
/// </summary>
public
static
bool
IsLambdaBody
(
SyntaxNode
node
)
{
return
Syntax
Utilities
.
IsLambdaBody
(
node
);
return
Lambda
Utilities
.
IsLambdaBody
(
node
);
}
}
}
\ No newline at end of file
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
浏览文件 @
a037aede
...
...
@@ -921,7 +921,7 @@
<Compile
Include=
"Syntax\SyntaxTreeDiagnosticEnumerator.vb"
/>
<Compile
Include=
"Syntax\SyntaxTriviaFunctions.vb"
/>
<Compile
Include=
"Syntax\SyntaxTriviaListBuilder.vb"
/>
<Compile
Include=
"Syntax\
Syntax
Utilities.vb"
/>
<Compile
Include=
"Syntax\
Lambda
Utilities.vb"
/>
<Compile
Include=
"Syntax\TypeBlockSyntax.vb"
/>
<Compile
Include=
"Syntax\TypeStatementSyntax.vb"
/>
<Compile
Include=
"Syntax\VisualBasicWarningStateMap.vb"
/>
...
...
src/Compilers/VisualBasic/Portable/Binding/Binder_Query.vb
浏览文件 @
a037aede
...
...
@@ -307,7 +307,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
aggregate
,
source
.
RangeVariables
)
' The lambda that will contain the nested query.
Dim
letSelectorLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetAggregateLambdaBody
(
aggregate
),
Dim
letSelectorLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetAggregateLambdaBody
(
aggregate
),
SynthesizedLambdaKind
.
AggregateQueryLambda
,
ImmutableArray
.
Create
(
letSelectorParam
))
...
...
@@ -432,7 +432,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
aggregate
,
letOperator
.
RangeVariables
)
' This lambda only contains non-user code. We associate it with the aggregate clause itself.
Debug
.
Assert
(
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
aggregate
))
Debug
.
Assert
(
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
aggregate
))
Dim
selectSelectorLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
aggregate
,
SynthesizedLambdaKind
.
AggregateNonUserCodeQueryLambda
,
ImmutableArray
.
Create
(
selectSelectorParam
))
...
...
@@ -603,7 +603,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
fromClauseSyntax
,
source
.
RangeVariables
)
' An implicit selector is an identity (x => x) function that doesn't contain any user code.
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
fromClauseSyntax
)
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
fromClauseSyntax
)
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
fromClauseSyntax
,
SynthesizedLambdaKind
.
FromNonUserCodeQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
@@ -675,7 +675,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
clauseSyntax
,
source
.
RangeVariables
)
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetSelectLambdaBody
(
clauseSyntax
),
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetSelectLambdaBody
(
clauseSyntax
),
SynthesizedLambdaKind
.
SelectQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
@@ -821,7 +821,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
variable
,
source
.
RangeVariables
)
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetLetVariableLambdaBody
(
variable
),
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetLetVariableLambdaBody
(
variable
),
SynthesizedLambdaKind
.
LetVariableQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
@@ -1053,7 +1053,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
variable
,
source
.
RangeVariables
)
Dim
manySelectorLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetFromOrAggregateVariableLambdaBody
(
variable
),
Dim
manySelectorLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetFromOrAggregateVariableLambdaBody
(
variable
),
SynthesizedLambdaKind
.
FromOrAggregateVariableQueryLambda
,
ImmutableArray
.
Create
(
manySelectorParam
))
...
...
@@ -1248,29 +1248,29 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Select
lambdaSyntax
=
clauseSyntax
Debug
.
Assert
(
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
lambdaSyntax
))
Debug
.
Assert
(
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
lambdaSyntax
))
Else
Select
Case
absorbNextOperator
.
Kind
Case
SyntaxKind
.
AggregateClause
Dim
firstVariable
=
DirectCast
(
absorbNextOperator
,
AggregateClauseSyntax
).
Variables
.
First
lambdaSyntax
=
Syntax
Utilities
.
GetFromOrAggregateVariableLambdaBody
(
firstVariable
)
lambdaSyntax
=
Lambda
Utilities
.
GetFromOrAggregateVariableLambdaBody
(
firstVariable
)
lambdaKind
=
SynthesizedLambdaKind
.
AggregateQueryLambda
Case
SyntaxKind
.
LetClause
Dim
firstVariable
=
DirectCast
(
absorbNextOperator
,
LetClauseSyntax
).
Variables
.
First
lambdaSyntax
=
Syntax
Utilities
.
GetLetVariableLambdaBody
(
firstVariable
)
lambdaSyntax
=
Lambda
Utilities
.
GetLetVariableLambdaBody
(
firstVariable
)
lambdaKind
=
SynthesizedLambdaKind
.
LetVariableQueryLambda
Case
SyntaxKind
.
SelectClause
Dim
selectClause
=
DirectCast
(
absorbNextOperator
,
SelectClauseSyntax
)
lambdaSyntax
=
Syntax
Utilities
.
GetSelectLambdaBody
(
selectClause
)
lambdaSyntax
=
Lambda
Utilities
.
GetSelectLambdaBody
(
selectClause
)
lambdaKind
=
SynthesizedLambdaKind
.
SelectQueryLambda
Case
Else
Throw
ExceptionUtilities
.
UnexpectedValue
(
absorbNextOperator
.
Kind
)
End
Select
Debug
.
Assert
(
Syntax
Utilities
.
IsLambdaBody
(
lambdaSyntax
))
Debug
.
Assert
(
Lambda
Utilities
.
IsLambdaBody
(
lambdaSyntax
))
End
If
End
Sub
...
...
@@ -1920,7 +1920,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
groupBy
,
source
.
RangeVariables
)
Dim
itemsLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetGroupByItemsLambdaBody
(
groupBy
),
Dim
itemsLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetGroupByItemsLambdaBody
(
groupBy
),
SynthesizedLambdaKind
.
GroupByItemsQueryLambda
,
ImmutableArray
.
Create
(
itemsParam
))
...
...
@@ -1964,7 +1964,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
groupBy
,
source
.
RangeVariables
)
Dim
keysLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetGroupByKeysLambdaBody
(
groupBy
),
Dim
keysLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetGroupByKeysLambdaBody
(
groupBy
),
SynthesizedLambdaKind
.
GroupByKeysQueryLambda
,
ImmutableArray
.
Create
(
keysParam
))
...
...
@@ -2171,7 +2171,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim
groupParam
As
BoundLambdaParameterSymbol
=
CreateQueryLambdaParameterSymbol
(
StringConstants
.
ItAnonymous
,
1
,
groupType
,
clauseSyntax
)
Debug
.
Assert
(
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
clauseSyntax
))
Debug
.
Assert
(
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
clauseSyntax
))
Dim
intoLambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
clauseSyntax
,
SynthesizedLambdaKind
.
GroupNonUserCodeQueryLambda
,
ImmutableArray
.
Create
(
keyParam
,
groupParam
))
...
...
@@ -2370,7 +2370,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
condition
,
source
.
RangeVariables
)
Debug
.
Assert
(
Syntax
Utilities
.
IsLambdaBody
(
condition
))
Debug
.
Assert
(
Lambda
Utilities
.
IsLambdaBody
(
condition
))
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
condition
,
SynthesizedLambdaKind
.
FilterConditionQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
@@ -2621,7 +2621,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
source
.
CompoundVariableType
,
ordering
.
Expression
,
source
.
RangeVariables
)
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetOrderingLambdaBody
(
ordering
),
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetOrderingLambdaBody
(
ordering
),
SynthesizedLambdaKind
.
OrderingQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
@@ -3340,7 +3340,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
outer
.
CompoundVariableType
,
join
,
outer
.
RangeVariables
)
Dim
outerKeyLambdaSymbol
=
parentBinder
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetJoinLeftLambdaBody
(
join
),
Dim
outerKeyLambdaSymbol
=
parentBinder
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetJoinLeftLambdaBody
(
join
),
SynthesizedLambdaKind
.
JoinLeftQueryLambda
,
ImmutableArray
.
Create
(
outerKeyParam
))
outerKeyBinder
=
New
QueryLambdaBinder
(
outerKeyLambdaSymbol
,
joinSelectorRangeVariables
)
...
...
@@ -3350,7 +3350,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
inner
.
CompoundVariableType
,
join
,
inner
.
RangeVariables
)
Dim
innerKeyLambdaSymbol
=
parentBinder
.
CreateQueryLambdaSymbol
(
Syntax
Utilities
.
GetJoinRightLambdaBody
(
join
),
Dim
innerKeyLambdaSymbol
=
parentBinder
.
CreateQueryLambdaSymbol
(
Lambda
Utilities
.
GetJoinRightLambdaBody
(
join
),
SynthesizedLambdaKind
.
JoinRightQueryLambda
,
ImmutableArray
.
Create
(
innerKeyParam
))
...
...
@@ -3995,7 +3995,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' its special binding and Lookup/LookupNames behavior.
Dim
aggregationLambdaSymbol
=
Me
.
ContainingBinder
.
CreateQueryLambdaSymbol
(
If
(
Syntax
Utilities
.
GetAggregationLambdaBody
(
functionAggregationSyntax
),
functionAggregationSyntax
),
If
(
Lambda
Utilities
.
GetAggregationLambdaBody
(
functionAggregationSyntax
),
functionAggregationSyntax
),
SynthesizedLambdaKind
.
AggregationQueryLambda
,
ImmutableArray
.
Create
(
aggregationParam
))
...
...
@@ -4342,7 +4342,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
variableType
,
syntax
.
AsClause
)
Debug
.
Assert
(
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
syntax
.
AsClause
))
Debug
.
Assert
(
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
syntax
.
AsClause
))
Dim
lambdaSymbol
=
Me
.
CreateQueryLambdaSymbol
(
syntax
.
AsClause
,
SynthesizedLambdaKind
.
ConversionNonUserCodeQueryLambda
,
ImmutableArray
.
Create
(
param
))
...
...
src/Compilers/VisualBasic/Portable/BoundTree/BoundLambda.vb
浏览文件 @
a037aede
...
...
@@ -36,9 +36,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Debug
.
Assert
(
TypeOf
Syntax
Is
LambdaExpressionSyntax
OrElse
Syntax
Utilities
.
IsLambdaBody
(
Syntax
)
OrElse
Lambda
Utilities
.
IsLambdaBody
(
Syntax
)
OrElse
Syntax
.
IsKind
(
SyntaxKind
.
AddressOfExpression
)
OrElse
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
Syntax
)
OrElse
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
Syntax
)
OrElse
(
DelegateRelaxation
And
ConversionKind
.
DelegateRelaxationLevelMask
)
<>
ConversionKind
.
DelegateRelaxationLevelNone
)
End
Sub
#End If
...
...
src/Compilers/VisualBasic/Portable/Lowering/LambdaRewriter/LambdaFrame.vb
浏览文件 @
a037aede
...
...
@@ -114,7 +114,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
End
If
If
Syntax
Utilities
.
IsClosureScope
(
syntaxOpt
)
Then
If
Lambda
Utilities
.
IsClosureScope
(
syntaxOpt
)
Then
Return
End
If
...
...
src/Compilers/VisualBasic/Portable/Lowering/LambdaRewriter/LambdaRewriter.vb
浏览文件 @
a037aede
...
...
@@ -926,14 +926,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim
lambdaExpression
=
TryCast
(
syntax
,
LambdaExpressionSyntax
)
If
lambdaExpression
IsNot
Nothing
Then
lambdaOrLambdaBodySyntax
=
Syntax
Utilities
.
GetLambdaExpressionLambdaBody
(
lambdaExpression
)
lambdaOrLambdaBodySyntax
=
Lambda
Utilities
.
GetLambdaExpressionLambdaBody
(
lambdaExpression
)
isLambdaBody
=
True
ElseIf
syntax
.
IsKind
(
SyntaxKind
.
AddressOfExpression
)
Then
' Late-bound AddressOf operator creates a display class, unlike delegate relaxations.
' EnC is not supported in this case.
lambdaOrLambdaBodySyntax
=
syntax
isLambdaBody
=
False
ElseIf
Syntax
Utilities
.
IsNonUserCodeQueryLambda
(
syntax
)
ElseIf
Lambda
Utilities
.
IsNonUserCodeQueryLambda
(
syntax
)
lambdaOrLambdaBodySyntax
=
syntax
isLambdaBody
=
False
Else
...
...
@@ -942,7 +942,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
isLambdaBody
=
True
End
If
Debug
.
Assert
(
Not
isLambdaBody
OrElse
Syntax
Utilities
.
IsLambdaBody
(
lambdaOrLambdaBodySyntax
))
Debug
.
Assert
(
Not
isLambdaBody
OrElse
Lambda
Utilities
.
IsLambdaBody
(
lambdaOrLambdaBodySyntax
))
' determine lambda ordinal and calculate syntax offset
lambdaOrdinal
=
_lambdaDebugInfoBuilder
.
Count
...
...
src/Compilers/VisualBasic/Portable/Syntax/
Syntax
Utilities.vb
→
src/Compilers/VisualBasic/Portable/Syntax/
Lambda
Utilities.vb
浏览文件 @
a037aede
...
...
@@ -5,7 +5,7 @@ Imports System.Runtime.InteropServices
Namespace
Microsoft.CodeAnalysis.VisualBasic
Friend
NotInheritable
Class
Syntax
Utilities
Friend
NotInheritable
Class
Lambda
Utilities
''' <summary>
''' Returns true if the specified node represents a lambda.
...
...
src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb
浏览文件 @
a037aede
...
...
@@ -678,11 +678,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Function
Friend
Overrides
Function
GetCorrespondingLambdaBody
(
body
As
SyntaxNode
)
As
SyntaxNode
Return
Syntax
Utilities
.
GetCorrespondingLambdaBody
(
body
,
Me
)
Return
Lambda
Utilities
.
GetCorrespondingLambdaBody
(
body
,
Me
)
End
Function
Friend
Overrides
Function
GetLambda
()
As
SyntaxNode
Return
Syntax
Utilities
.
GetLambda
(
Me
)
Return
Lambda
Utilities
.
GetLambda
(
Me
)
End
Function
End
Class
End
Namespace
src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueClosureTests.vb
浏览文件 @
a037aede
...
...
@@ -766,7 +766,7 @@ End Class
''' of the same kind is mapped to a new node that belongs to the lambda body but is
''' different from the one that represents the new body.
'''
''' This handling is done in <see cref="
Syntax
Utilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/>
''' This handling is done in <see cref="
Lambda
Utilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/>
''' </summary>
<
Fact
>
Public
Sub
SelectClauseCrossMatch
()
...
...
@@ -829,7 +829,7 @@ End Class
''' of the same kind is mapped to a new node that belongs to the lambda body but is
''' different from the one that represents the new body.
'''
''' This handling is done in <see cref="
Syntax
Utilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/>
''' This handling is done in <see cref="
Lambda
Utilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/>
''' </summary>
<
Fact
>
Public
Sub
JoinClauseCrossMatch
()
...
...
src/Features/CSharp/CSharpFeatures.csproj
浏览文件 @
a037aede
...
...
@@ -84,8 +84,8 @@
<InternalsVisibleToTest
Include=
"Roslyn.Services.UnitTests"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Compilers\CSharp\Portable\Syntax\
Syntax
Utilities.cs"
>
<Link>
InternalUtilities\
Syntax
Utilities.cs
</Link>
<Compile
Include=
"..\..\Compilers\CSharp\Portable\Syntax\
Lambda
Utilities.cs"
>
<Link>
InternalUtilities\
Lambda
Utilities.cs
</Link>
</Compile>
<Compile
Include=
"ChangeSignature\ChangeSignatureCodeRefactoringProvider.cs"
/>
<Compile
Include=
"ChangeSignature\ChangeSignatureFormattingRule.cs"
/>
...
...
src/Features/CSharp/EditAndContinue/CSharpEditAndContinueAnalyzer.cs
浏览文件 @
a037aede
...
...
@@ -16,7 +16,6 @@
using
Microsoft.CodeAnalysis.Shared.Extensions
;
using
Microsoft.CodeAnalysis.Text
;
using
Roslyn.Utilities
;
using
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
CSharp
.
SyntaxUtilities
;
namespace
Microsoft.CodeAnalysis.CSharp.EditAndContinue
{
...
...
@@ -290,7 +289,7 @@ protected override SyntaxNode FindStatementAndPartner(SyntaxNode declarationBody
partnerOpt
=
null
;
}
while
(
node
!=
declarationBody
&&
!
StatementSyntaxComparer
.
HasLabel
(
node
)
&&
!
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
))
while
(
node
!=
declarationBody
&&
!
StatementSyntaxComparer
.
HasLabel
(
node
)
&&
!
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
))
{
node
=
node
.
Parent
;
if
(
partnerOpt
!=
null
)
...
...
@@ -389,7 +388,7 @@ private static TextSpan GetActiveSpan(ForEachStatementSyntax node, ForEachPart p
internal
override
bool
IsClosureScope
(
SyntaxNode
node
)
{
return
CompilerSyntax
Utilities
.
IsClosureScope
(
node
);
return
Lambda
Utilities
.
IsClosureScope
(
node
);
}
protected
override
SyntaxNode
FindEnclosingLambdaBody
(
SyntaxNode
containerOpt
,
SyntaxNode
node
)
...
...
@@ -399,7 +398,7 @@ protected override SyntaxNode FindEnclosingLambdaBody(SyntaxNode containerOpt, S
while
(
node
!=
root
)
{
SyntaxNode
body
;
if
(
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
,
out
body
))
if
(
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
,
out
body
))
{
return
body
;
}
...
...
@@ -417,7 +416,7 @@ protected override SyntaxList<SyntaxNode> GetLambdaBodyExpressionsAndStatements(
protected
override
SyntaxNode
GetPartnerLambdaBody
(
SyntaxNode
oldBody
,
SyntaxNode
newLambda
)
{
return
CompilerSyntax
Utilities
.
GetCorrespondingLambdaBody
(
oldBody
,
newLambda
);
return
Lambda
Utilities
.
GetCorrespondingLambdaBody
(
oldBody
,
newLambda
);
}
protected
override
Match
<
SyntaxNode
>
ComputeTopLevelMatch
(
SyntaxNode
oldCompilationUnit
,
SyntaxNode
newCompilationUnit
)
...
...
@@ -880,22 +879,22 @@ private static bool IsGetterToExpressionBodyTransformation(EditKind editKind, Sy
internal
override
bool
ContainsLambda
(
SyntaxNode
declaration
)
{
return
declaration
.
DescendantNodes
().
Any
(
CompilerSyntax
Utilities
.
IsLambda
);
return
declaration
.
DescendantNodes
().
Any
(
Lambda
Utilities
.
IsLambda
);
}
internal
override
bool
IsLambda
(
SyntaxNode
node
)
{
return
CompilerSyntax
Utilities
.
IsLambda
(
node
);
return
Lambda
Utilities
.
IsLambda
(
node
);
}
internal
override
bool
TryGetLambdaBodies
(
SyntaxNode
node
,
out
SyntaxNode
body1
,
out
SyntaxNode
body2
)
{
return
CompilerSyntax
Utilities
.
TryGetLambdaBodies
(
node
,
out
body1
,
out
body2
);
return
Lambda
Utilities
.
TryGetLambdaBodies
(
node
,
out
body1
,
out
body2
);
}
internal
override
SyntaxNode
GetLambda
(
SyntaxNode
lambdaBody
)
{
return
CompilerSyntax
Utilities
.
GetLambda
(
lambdaBody
);
return
Lambda
Utilities
.
GetLambda
(
lambdaBody
);
}
#
endregion
...
...
@@ -2613,7 +2612,7 @@ protected override List<SyntaxNode> GetExceptionHandlingAncestors(SyntaxNode nod
}
// stop at lambda:
if
(
CompilerSyntax
Utilities
.
IsLambda
(
node
))
if
(
Lambda
Utilities
.
IsLambda
(
node
))
{
return
result
;
}
...
...
@@ -2776,7 +2775,7 @@ private static SyntaxNode FindContainingStatementPart(SyntaxNode node)
return
node
;
}
if
(
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
))
if
(
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
))
{
return
node
;
}
...
...
src/Features/CSharp/EditAndContinue/StatementSyntaxComparer.cs
浏览文件 @
a037aede
...
...
@@ -5,7 +5,6 @@
using
System.Diagnostics
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Roslyn.Utilities
;
using
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
CSharp
.
SyntaxUtilities
;
namespace
Microsoft.CodeAnalysis.CSharp.EditAndContinue
{
...
...
@@ -59,7 +58,7 @@ private IEnumerable<SyntaxNode> EnumerateNonRootChildren(SyntaxNode node)
{
foreach
(
var
child
in
node
.
ChildNodes
())
{
if
(
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
child
))
if
(
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
child
))
{
continue
;
}
...
...
@@ -105,7 +104,7 @@ private IEnumerable<SyntaxNode> EnumerateRootChildren(SyntaxNode root)
private
bool
DescendIntoChildren
(
SyntaxNode
node
)
{
return
!
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
&&
!
HasLabel
(
node
);
return
!
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
&&
!
HasLabel
(
node
);
}
protected
internal
sealed
override
IEnumerable
<
SyntaxNode
>
GetDescendants
(
SyntaxNode
node
)
...
...
@@ -125,9 +124,9 @@ protected internal sealed override IEnumerable<SyntaxNode> GetDescendants(Syntax
}
// TODO: avoid allocation of closure
foreach
(
var
descendant
in
node
.
DescendantNodes
(
descendIntoChildren
:
c
=>
!
IsLeaf
(
c
)
&&
(
c
==
node
||
!
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
))))
foreach
(
var
descendant
in
node
.
DescendantNodes
(
descendIntoChildren
:
c
=>
!
IsLeaf
(
c
)
&&
(
c
==
node
||
!
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
))))
{
if
(!
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
&&
HasLabel
(
descendant
))
if
(!
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
&&
HasLabel
(
descendant
))
{
yield
return
descendant
;
}
...
...
src/Features/CSharp/EditAndContinue/SyntaxUtilities.cs
浏览文件 @
a037aede
...
...
@@ -6,7 +6,6 @@
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Roslyn.Utilities
;
using
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
CSharp
.
SyntaxUtilities
;
namespace
Microsoft.CodeAnalysis.CSharp.EditAndContinue
{
...
...
@@ -274,7 +273,7 @@ public static bool IsAsyncMethodOrLambda(SyntaxNode declaration)
public
static
ImmutableArray
<
SyntaxNode
>
GetAwaitExpressions
(
SyntaxNode
body
)
{
// skip lambda bodies:
return
ImmutableArray
.
CreateRange
(
body
.
DescendantNodesAndSelf
(
CompilerSyntax
Utilities
.
IsNotLambda
).
Where
(
n
=>
n
.
IsKind
(
SyntaxKind
.
AwaitExpression
)));
return
ImmutableArray
.
CreateRange
(
body
.
DescendantNodesAndSelf
(
Lambda
Utilities
.
IsNotLambda
).
Where
(
n
=>
n
.
IsKind
(
SyntaxKind
.
AwaitExpression
)));
}
public
static
ImmutableArray
<
SyntaxNode
>
GetYieldStatements
(
SyntaxNode
body
)
...
...
src/Features/VisualBasic/BasicFeatures.vbproj
浏览文件 @
a037aede
...
...
@@ -118,8 +118,8 @@
<Import
Include=
"System.Xml.Linq"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Compilers\VisualBasic\Portable\Syntax\
Syntax
Utilities.vb"
>
<Link>
InternalUtilities\
Syntax
Utilities.vb
</Link>
<Compile
Include=
"..\..\Compilers\VisualBasic\Portable\Syntax\
Lambda
Utilities.vb"
>
<Link>
InternalUtilities\
Lambda
Utilities.vb
</Link>
</Compile>
<Compile
Include=
"ChangeSignature\ChangeSignatureCodeRefactoringProvider.vb"
/>
<Compile
Include=
"ChangeSignature\ChangeSignatureFormattingRule.vb"
/>
...
...
src/Features/VisualBasic/EditAndContinue/StatementSyntaxComparer.vb
浏览文件 @
a037aede
...
...
@@ -2,7 +2,6 @@
Imports
System.Runtime.InteropServices
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
VisualBasic
.
SyntaxUtilities
Namespace
Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
...
...
@@ -75,7 +74,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
For
Each
child
In
node
.
ChildNodes
()
If
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
child
)
Then
If
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
child
)
Then
Continue
For
End
If
...
...
@@ -103,17 +102,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
If
' TODO: avoid allocation of closure
For
Each
descendant
In
rootChild
.
DescendantNodes
(
descendIntoChildren
:
=
Function
(
c
)
Not
IsLeaf
(
c
)
AndAlso
(
c
Is
rootChild
OrElse
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
)))
If
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
AndAlso
HasLabel
(
descendant
)
Then
For
Each
descendant
In
rootChild
.
DescendantNodes
(
descendIntoChildren
:
=
Function
(
c
)
Not
IsLeaf
(
c
)
AndAlso
(
c
Is
rootChild
OrElse
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
)))
If
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
AndAlso
HasLabel
(
descendant
)
Then
Yield
descendant
End
If
Next
Next
Else
' TODO: avoid allocation of closure
Dim
descendants
=
node
.
DescendantNodes
(
descendIntoChildren
:
=
Function
(
c
)
Not
IsLeaf
(
c
)
AndAlso
(
c
Is
node
OrElse
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
)))
Dim
descendants
=
node
.
DescendantNodes
(
descendIntoChildren
:
=
Function
(
c
)
Not
IsLeaf
(
c
)
AndAlso
(
c
Is
node
OrElse
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
c
)))
For
Each
descendant
In
descendants
If
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
AndAlso
HasLabel
(
descendant
)
Then
If
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
descendant
)
AndAlso
HasLabel
(
descendant
)
Then
Yield
descendant
End
If
Next
...
...
@@ -121,7 +120,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
Function
Private
Function
DescendIntoChildren
(
node
As
SyntaxNode
)
As
Boolean
Return
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
AndAlso
Not
HasLabel
(
node
)
Return
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
AndAlso
Not
HasLabel
(
node
)
End
Function
#End Region
...
...
src/Features/VisualBasic/EditAndContinue/SyntaxUtilities.vb
浏览文件 @
a037aede
...
...
@@ -4,14 +4,13 @@ Imports System.Collections.Immutable
Imports
System.Runtime.CompilerServices
Imports
System.Runtime.InteropServices
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
VisualBasic
.
SyntaxUtilities
Namespace
Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
Friend
NotInheritable
Class
SyntaxUtilities
<
Conditional
(
"DEBUG"
)
>
Public
Shared
Sub
AssertIsBody
(
syntax
As
SyntaxNode
,
allowLambda
As
Boolean
)
' lambda/query
If
CompilerSyntax
Utilities
.
IsLambdaBody
(
syntax
)
Then
If
Lambda
Utilities
.
IsLambdaBody
(
syntax
)
Then
Debug
.
Assert
(
allowLambda
)
Debug
.
Assert
(
TypeOf
syntax
Is
ExpressionSyntax
OrElse
TypeOf
syntax
Is
LambdaHeaderSyntax
)
Return
...
...
@@ -152,7 +151,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
Public
Shared
Function
GetAwaitExpressions
(
body
As
SyntaxNode
)
As
ImmutableArray
(
Of
SyntaxNode
)
' skip lambda bodies
Return
ImmutableArray
.
CreateRange
(
body
.
DescendantNodes
(
AddressOf
CompilerSyntax
Utilities
.
IsNotLambda
).
Return
ImmutableArray
.
CreateRange
(
body
.
DescendantNodes
(
AddressOf
Lambda
Utilities
.
IsNotLambda
).
Where
(
Function
(
n
)
n
.
IsKind
(
SyntaxKind
.
AwaitExpression
)))
End
Function
...
...
src/Features/VisualBasic/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb
浏览文件 @
a037aede
...
...
@@ -10,7 +10,6 @@ Imports Microsoft.CodeAnalysis.Host
Imports
Microsoft.CodeAnalysis.Host.Mef
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports
CompilerSyntaxUtilities
=
Microsoft
.
CodeAnalysis
.
VisualBasic
.
SyntaxUtilities
Namespace
Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
<
ExportLanguageService
(
GetType
(
IEditAndContinueAnalyzer
),
LanguageNames
.
VisualBasic
),
[
Shared
]
>
...
...
@@ -423,7 +422,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
While
node
IsNot
declarationBody
AndAlso
Not
StatementSyntaxComparer
.
HasLabel
(
node
)
AndAlso
Not
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
Not
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
node
=
node
.
Parent
If
partnerOpt
IsNot
Nothing
Then
...
...
@@ -449,7 +448,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
Function
Friend
Overrides
Function
IsClosureScope
(
node
As
SyntaxNode
)
As
Boolean
Return
CompilerSyntax
Utilities
.
IsClosureScope
(
node
)
Return
Lambda
Utilities
.
IsClosureScope
(
node
)
End
Function
Protected
Overrides
Function
FindEnclosingLambdaBody
(
containerOpt
As
SyntaxNode
,
node
As
SyntaxNode
)
As
SyntaxNode
...
...
@@ -457,7 +456,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
While
node
IsNot
root
Dim
body
As
SyntaxNode
=
Nothing
If
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
,
body
)
Then
If
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
,
body
)
Then
Return
body
End
If
...
...
@@ -468,7 +467,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
Function
Protected
Overrides
Function
GetPartnerLambdaBody
(
oldBody
As
SyntaxNode
,
newLambda
As
SyntaxNode
)
As
SyntaxNode
Return
CompilerSyntax
Utilities
.
GetCorrespondingLambdaBody
(
oldBody
,
newLambda
)
Return
Lambda
Utilities
.
GetCorrespondingLambdaBody
(
oldBody
,
newLambda
)
End
Function
Protected
Overrides
Function
ComputeTopLevelMatch
(
oldCompilationUnit
As
SyntaxNode
,
newCompilationUnit
As
SyntaxNode
)
As
Match
(
Of
SyntaxNode
)
...
...
@@ -931,23 +930,23 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
Function
Friend
Overrides
Function
ContainsLambda
(
declaration
As
SyntaxNode
)
As
Boolean
Return
declaration
.
DescendantNodes
().
Any
(
AddressOf
CompilerSyntax
Utilities
.
IsLambda
)
Return
declaration
.
DescendantNodes
().
Any
(
AddressOf
Lambda
Utilities
.
IsLambda
)
End
Function
Friend
Overrides
Function
IsLambda
(
node
As
SyntaxNode
)
As
Boolean
Return
CompilerSyntax
Utilities
.
IsLambda
(
node
)
Return
Lambda
Utilities
.
IsLambda
(
node
)
End
Function
Friend
Overrides
Function
TryGetLambdaBodies
(
node
As
SyntaxNode
,
ByRef
body1
As
SyntaxNode
,
ByRef
body2
As
SyntaxNode
)
As
Boolean
Return
CompilerSyntax
Utilities
.
TryGetLambdaBodies
(
node
,
body1
,
body2
)
Return
Lambda
Utilities
.
TryGetLambdaBodies
(
node
,
body1
,
body2
)
End
Function
Friend
Overrides
Function
GetLambda
(
lambdaBody
As
SyntaxNode
)
As
SyntaxNode
Return
CompilerSyntax
Utilities
.
GetLambda
(
lambdaBody
)
Return
Lambda
Utilities
.
GetLambda
(
lambdaBody
)
End
Function
Protected
Overrides
Function
GetLambdaBodyExpressionsAndStatements
(
lambdaBody
As
SyntaxNode
)
As
SyntaxList
(
Of
SyntaxNode
)
Return
CompilerSyntax
Utilities
.
GetLambdaBodyExpressionsAndStatements
(
lambdaBody
)
Return
Lambda
Utilities
.
GetLambdaBodyExpressionsAndStatements
(
lambdaBody
)
End
Function
#End Region
...
...
@@ -2694,7 +2693,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
End
Select
' stop at lambda
If
CompilerSyntax
Utilities
.
IsLambda
(
node
)
Then
If
Lambda
Utilities
.
IsLambda
(
node
)
Then
Exit
While
End
If
...
...
@@ -2813,7 +2812,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
Return
node
End
Select
If
CompilerSyntax
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
Then
If
Lambda
Utilities
.
IsLambdaBodyStatementOrExpression
(
node
)
Then
Return
node
End
If
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录