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