29 references to SyntaxUtilities
Microsoft.CodeAnalysis.CSharp.Features (7)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (3)
31
IsAsync:
SyntaxUtilities
.IsAsyncDeclaration(node.Parent!),
32
IsIterator:
SyntaxUtilities
.IsIterator(node),
33
HasSuspensionPoints:
SyntaxUtilities
.GetSuspensionPoints(node).Any());
EditAndContinue\DeclarationBody\SimpleMemberBody.cs (3)
26
IsAsync:
SyntaxUtilities
.IsAsyncDeclaration(Node.Parent!),
27
IsIterator:
SyntaxUtilities
.IsIterator(Node),
28
HasSuspensionPoints:
SyntaxUtilities
.GetSuspensionPoints(Node).Any());
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
43
var isAsync = GlobalStatements.Any(static s =>
SyntaxUtilities
.GetSuspensionPoints(s).Any());
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
EditAndContinue\SyntaxUtilitiesTests.cs (22)
201
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(m0.ExpressionBody));
202
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(m1.ExpressionBody));
203
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(m2));
204
Assert.False(
SyntaxUtilities
.IsAsyncDeclaration(m3));
205
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(f1.ExpressionBody));
206
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(f2));
207
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(l1));
208
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(l2));
209
Assert.True(
SyntaxUtilities
.IsAsyncDeclaration(l3));
211
Assert.Equal(0,
SyntaxUtilities
.GetSuspensionPoints(m0.ExpressionBody).Count());
212
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(m1.ExpressionBody).Count());
213
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(m2.Body).Count());
214
Assert.Equal(0,
SyntaxUtilities
.GetSuspensionPoints(m3.Body).Count());
215
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(f1.ExpressionBody).Count());
216
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(f2.Body).Count());
217
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(l1.Body).Count());
218
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(l2.Body).Count());
219
Assert.Equal(1,
SyntaxUtilities
.GetSuspensionPoints(l3.Body).Count());
257
AssertEx.Empty(
SyntaxUtilities
.GetSuspensionPoints(x.Initializer));
258
AssertEx.Equal(["yield return 1;"],
SyntaxUtilities
.GetSuspensionPoints(m1.Body).Select(n => n.ToString()));
259
AssertEx.Empty(
SyntaxUtilities
.GetSuspensionPoints(m2.Body));
270
],
SyntaxUtilities
.GetSuspensionPoints(f.Body).Select(n => n.ToString()));