3367 references to DescendantNodes
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
269
var allNodes = comp.SyntaxTrees.SelectMany(s => s.GetRoot().
DescendantNodes
());
Microsoft.Analyzers.Extra.Tests (4)
SyntaxNodeExtensionsTests.cs (4)
54
var methodInvocSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().FirstOrDefault();
86
var methodInvocSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().FirstOrDefault();
149
var methodInvocSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().FirstOrDefault();
179
var methodInvocSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().FirstOrDefault();
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
96
.
DescendantNodes
()
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (1)
43
&& parentNode.
DescendantNodes
().Count() > 1;
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
281
.
DescendantNodes
()
Microsoft.AspNetCore.App.CodeFixes (1)
Authorization\AddAuthorizationBuilderFixer.cs (1)
68
nodes = lambdaBlockBody.
DescendantNodes
();
Microsoft.CodeAnalysis (1)
Syntax\SyntaxTreeExtensions.cs (1)
35
node = root.
DescendantNodes
(n => n.FullSpan.Contains(change)).LastOrDefault();
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
105
.
DescendantNodes
(n => n is TNamespaceSyntax)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
607
foreach (var node in docComment.
DescendantNodes
().OfType<TIdentifierNameSyntax>())
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
151
if (operationBlock.Syntax.
DescendantNodes
(descendIntoTrivia: true)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
210
foreach (var node in analysisRoot.
DescendantNodes
())
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
35
node = root.
DescendantNodes
(n => n.FullSpan.Contains(change)).LastOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
262
foreach (var node in containerDeclaration.
DescendantNodes
())
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
135
nodes = docComment.
DescendantNodes
(descendIntoChildren: _ => true)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
192
var returns = node.
DescendantNodes
(n => n == node || !IsAsyncSupportingFunctionSyntax(n)).OfType<TReturnStatementSyntax>();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
634
foreach (var localDeclarationStatement in containingMemberDeclaration.
DescendantNodes
().OfType<TLocalDeclarationStatementSyntax>())
789
foreach (var memberDecl in newRoot.
DescendantNodes
().Where(n => n.HasAnnotation(s_memberAnnotation)))
833
memberDeclaration.
DescendantNodes
()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
260
currentNodeOrToken = newRoot.
DescendantNodes
().Single(c => c.HasAnnotation(marker));
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
66
var methodDeclarations = root.
DescendantNodes
(n => n is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax or ClassDeclarationSyntax).OfType<MethodDeclarationSyntax>();
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
375
foreach (var descendentNode in enclosingBlockOfLocalStatement.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
118
if (parent.
DescendantNodes
().OfType<StatementSyntax>().Count() <= 1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
191
foreach (var candidate in outermostBody.
DescendantNodes
().OfType<ExpressionSyntax>())
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
56
foreach (var node in propertyDeclaration.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
524
foreach (var identifier in containingBlock.
DescendantNodes
().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
252
foreach (var identifierName in searchScope.
DescendantNodes
().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
245
foreach (var descendentNode in block.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
317
foreach (var descendentNode in _enclosingBlock.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
178
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
219
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
240
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
449
=> node.
DescendantNodes
(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
389
foreach (var localFunction in node.
DescendantNodes
().Where(CSharpSyntaxFacts.Instance.IsLocalFunctionStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
255
var originalIdentifierNodes = originalLambdaBody.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
261
var replacedIdentifierNodes = replacedLambdaBody.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
47
var descendentXmlElements = nodeStructure.
DescendantNodes
().OfType<XmlElementSyntax>();
62
.
DescendantNodes
(descendIntoChildren: _ => true, descendIntoTrivia: false)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
400
.
DescendantNodes
(node => node is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
239
parameterList.
DescendantNodes
().OfType<SimpleNameSyntax>(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
45
foreach (var child in memberDeclaration.
DescendantNodes
())
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
CodeGeneration\SyntaxGeneratorTests.cs (2)
42
var statement = root.
DescendantNodes
().Single(n => n is ReturnStatementSyntax);
76
var statement = root.
DescendantNodes
().Single(n => n is ReturnStatementSyntax);
Formatting\FormattingEngineTests.cs (1)
2224
var newRoot = root.InsertNodesBefore(root.
DescendantNodes
().Last(), [entry]);
SymbolKey\SymbolKeyTestBase.cs (7)
252
var usingNodes = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>();
350
var labels = body.
DescendantNodes
().OfType<LabeledStatementSyntax>();
358
var swlabels = body.
DescendantNodes
().OfType<SwitchLabelSyntax>();
372
IEnumerable<ExpressionSyntax> exprs = body.
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>();
373
IEnumerable<ExpressionSyntax> tmp = body.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>();
375
tmp = body.
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>();
378
tmp = body.
DescendantNodes
().OfType<AnonymousObjectCreationExpressionSyntax>();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (294)
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (2)
895
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToArray();
947
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToArray();
CodeGen\CodeGenAwaitForeachTests.cs (31)
936
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1661
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1721
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1865
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1902
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1942
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1979
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
2013
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
2969
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3034
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3119
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3237
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3292
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3350
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3546
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3594
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3715
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
4239
var loop = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
4462
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
4536
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
4646
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single();
4745
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single();
5049
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
5130
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
5356
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
6439
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9107
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9183
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9261
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9322
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9393
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single();
CodeGen\CodeGenCheckedTests.cs (3)
2915
var xNode = tree.GetRoot().
DescendantNodes
().OfType<CheckedExpressionSyntax>().Single().Expression;
2922
var checkedNode = tree.GetRoot().
DescendantNodes
().OfType<CheckedExpressionSyntax>().Single();
2947
var xNode = tree.GetRoot().
DescendantNodes
().OfType<CheckedExpressionSyntax>().Single().Expression;
CodeGen\CodeGenDeconstructTests.cs (46)
96
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
101
var right = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
1111
var deconstruction = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
1128
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
1366
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1423
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1467
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1508
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1561
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1668
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2688
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3130
var lhs = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().First();
3135
var lhsNested = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedVariableDesignationSyntax>().ElementAt(1);
3178
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3184
var x234 = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ElementAt(1);
3189
var x34 = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedVariableDesignationSyntax>().ElementAt(1);
3242
var x123 = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3248
var x23 = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
3280
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3286
var lhsNested = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ElementAt(1);
3330
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3336
var lhsNested = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ElementAt(2);
3443
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3447
var literal = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
3479
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
3483
var literal = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
3635
return tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == name).Single();
3640
return tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>();
3645
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ContextualKind() == SyntaxKind.UnderscoreToken);
3662
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name);
4042
var deconstructionForeach = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single();
4405
var collection = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single().Expression;
5472
var firstX1 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "x1").Single();
5504
var firstY = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "y").First();
5509
var secondY = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "y").ElementAt(1);
5535
var firstX = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "x").First();
5540
var secondX = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "x").ElementAt(1);
6408
var yz = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(2);
6413
var y = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ElementAt(1);
7067
var discard = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
7238
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
7520
var lhs = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(2);
8358
var node = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
8585
var node = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
8629
var node = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ElementAt(1);
9010
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First();
CodeGen\CodeGenForEachTests.cs (1)
1758
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
CodeGen\CodeGenFunctionPointersTests.cs (20)
3062
var addressOfs = syntaxTree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().ToArray();
3114
var addressOf = syntaxTree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
3339
var declarators = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Initializer!.Value.IsKind(SyntaxKind.AddressOfExpression)).ToArray();
3410
var declarator = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
3457
var declarator = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
3568
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
3620
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
3671
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
3710
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
4115
var variableDeclaratorSyntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
4919
.
DescendantNodes
()
7415
var lambda = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
7517
var functionPointerSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().ToArray();
7573
var functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
7593
functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
7642
var functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
7662
functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
7729
var functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
7747
functionPointerSyntax = tree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
10804
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToArray();
CodeGen\CodeGenInterpolatedString.cs (1)
37
var interpolatedStrings = tree.GetRoot().
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().ToArray();
CodeGen\CodeGenLocalFunctionTests.cs (6)
146
var localFunction = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
147
var creation = localFunction.
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
5749
.GetDeclaredSymbol(syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single())
5824
.GetDeclaredSymbol(syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single())
5897
var localFunctions = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToList();
6162
var localFunctionSyntax = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
CodeGen\CodeGenOperators.cs (3)
5409
ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single()));
5699
ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single()));
5735
ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single()));
CodeGen\CodeGenRefLocalTests.cs (6)
4033
var xDecl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
4036
var refVar = tree.GetRoot().
DescendantNodes
().OfType<RefTypeSyntax>().Single();
4070
var xDecl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
4073
var refVar = tree.GetRoot().
DescendantNodes
().OfType<RefTypeSyntax>().Single();
4104
var xDecl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
4107
var refInt = tree.GetRoot().
DescendantNodes
().OfType<RefTypeSyntax>().Single();
CodeGen\CodeGenTupleEqualityTests.cs (47)
362
var tupleX = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
381
var tupleY = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Last();
682
var tuple1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
688
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
713
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
769
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
793
var tuple1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
806
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
854
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
902
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
951
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
1001
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
1008
var lastEquals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Last();
1055
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1089
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1121
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1152
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1211
var defaults = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1311
var lastTuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Last();
1397
var literals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>();
1408
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1463
var defaultLiterals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>()
1497
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(3);
1557
var nulls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>();
1566
var tuples = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>();
1594
var lastLiteral = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Last();
1619
var rightTuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(2);
1675
var tuple1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
1683
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
1707
var addition = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Last();
1776
var tuple1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
1782
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
1918
var tuple1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
1924
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
2574
var firstEquals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
2582
var secondEquals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Last();
2642
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Last();
3278
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
3684
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
3808
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
3911
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
4036
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
4083
var comparison = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
4184
var lastNull = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Last();
4276
var comparison = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Last();
5122
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
5158
var equals = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
CodeGen\CodeGenTupleTest.cs (120)
1609
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3218
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3251
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3464
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3635
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3686
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3932
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3989
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4022
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4024
var result = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "result").Single();
4154
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4839
var invocation1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ElementAt(0);
4844
var invocation2 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ElementAt(2);
5075
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ElementAt(0);
5119
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ElementAt(0);
5160
var memberAccess = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ElementAt(0);
5164
var memberAccess2 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ElementAt(1);
5168
var memberAccess3 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ElementAt(2);
5204
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ElementAt(0);
5473
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
7497
var declaration = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
7530
var declaration = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
7568
var tuples = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>();
7631
var tuples = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>();
8291
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8322
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8377
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8406
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8435
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8483
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8517
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8550
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8579
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8626
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8661
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8690
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8719
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8749
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8804
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8834
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8893
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
8940
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9013
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9070
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9142
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9223
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9306
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
9854
var names = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
9905
var names = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
9947
var names = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
9993
var names = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
10059
var t1 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
10098
var t1 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(2);
10101
var t2 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
10132
var names = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
12693
var node = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
13974
var nameofNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "nameof").Single();
13981
var typeofNodes = tree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().ToArray();
14245
var m1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M1").Single();
14261
var m2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M2").Single();
14275
var f1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").First();
14289
var p1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "P1").First();
14306
var m3 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M3").Single();
14324
var m4 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M4").Single();
14331
var m5 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M5").Single();
14338
var m6 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M6").Single();
14433
var e1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "E1").Single();
14447
var m5 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "M5").Single();
14454
var v1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "v1").Single();
14464
var v2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "v2").Single();
16539
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
16566
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
16603
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17210
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17271
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17330
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17368
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17401
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
17434
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19229
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19291
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19394
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19425
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19479
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19537
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19660
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19704
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
19735
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
20357
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
21350
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
22855
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
24180
var nodes = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "elem2").ToArray();
24196
var type = tree.GetRoot().
DescendantNodes
().OfType<TupleTypeSyntax>().Single();
24259
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24269
var xSymbol = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single());
24322
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24332
var xSymbol = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single());
24386
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24396
var collection = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
24459
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24469
var collection = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
24532
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24542
var collection = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
24606
var derived = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().ElementAt(1);
24616
var collection = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
25024
var x = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
25053
var y = tree.GetRoot().
DescendantNodes
().OfType<TupleTypeSyntax>().ElementAt(0);
25058
var z = tree.GetRoot().
DescendantNodes
().OfType<TupleTypeSyntax>().ElementAt(1);
25084
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(0);
25703
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
25774
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
25839
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
25881
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(1);
25911
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
26223
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
26295
var doSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
26328
var doSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
26361
var doSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
26394
var doSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
27567
var literal = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
CodeGen\ForeachTest.cs (1)
1687
var decl = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
CodeGen\IndexAndRangeTests.cs (2)
34
return (model, root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToList());
3857
var receivers = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Select(e => e.Expression).ToArray();
CodeGen\ObjectAndCollectionInitializerTests.cs (2)
1107
var node = tree.GetRoot().
DescendantNodes
().OfType<Syntax.ObjectCreationExpressionSyntax>().Last();
3589
var node = tree.GetRoot().
DescendantNodes
().OfType<Syntax.ObjectCreationExpressionSyntax>().Single();
CodeGen\PatternTests.cs (3)
5004
var switchExpressions = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().ToArray();
5130
var attributeArguments = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().ToArray();
5279
var attributeArguments = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().ToArray();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (33)
CodeGen\IndexAndRangeTests.cs (18)
91
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Skip(2).First();
332
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
419
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
506
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
624
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
1573
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
1808
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
2263
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
2678
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
2841
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3019
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3133
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3304
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3455
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3641
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3731
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3817
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3890
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
Emit\NumericIntPtrTests.cs (15)
699
var actualLocals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
1917
var nodes = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>();
1969
var nodes = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>();
6009
var expr = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
6245
var expr = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
6621
var expr = tree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == kind);
6853
var expr = tree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == kind);
8126
var expr = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
10547
var returnStatements = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().ToArray();
10686
var methods = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ToArray();
11173
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
11196
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
11224
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
11249
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
11294
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (640)
Attributes\AttributeTests.cs (19)
87
var nodes = Parse(aliases).GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>();
707
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().Last();
710
var m0 = semanticModel.GetDeclaredSymbol(root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last());
748
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().Last();
752
var newAttrSyntax = newRoot.
DescendantNodes
().OfType<AttributeSyntax>().Last();
812
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().Last();
813
var interpolationSyntax = root.
DescendantNodes
().OfType<InterpolationSyntax>().Single();
817
var newAttrSyntax = newRoot.
DescendantNodes
().OfType<AttributeSyntax>().Last();
854
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().Last();
858
var newAttrSyntax = newRoot.
DescendantNodes
().OfType<AttributeSyntax>().Last();
895
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().Last();
899
var newAttrSyntax = newRoot.
DescendantNodes
().OfType<AttributeSyntax>().Last();
934
var attrSyntax = root.
DescendantNodes
().OfType<AttributeSyntax>().First();
938
var newAttrSyntax = newRoot.
DescendantNodes
().OfType<AttributeSyntax>().First();
7537
var attrArgSyntaxes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>();
7578
var attrArgSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Single();
11637
var firstArgument = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().First();
11641
var secondArgument = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Skip(1).First();
11645
var thirdArgument = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Skip(2).Single();
Attributes\AttributeTests_RefReadOnly.cs (4)
1379
var userFunction = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User");
1421
var userFunction = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User");
1450
var userFunction = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User");
1477
var userFunction = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User");
Attributes\AttributeTests_WellKnownAttributes.cs (7)
5768
var localFunctionSyntax = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
9550
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
9599
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
9655
var syntax = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Last(n => n.Identifier.ValueText == "OnBehaviorAttached");
11398
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
11423
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
11454
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
Diagnostics\DiagnosticAnalyzerTests.cs (4)
3682
var field1 = tree1.GetRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Single().Declaration.Variables.Single().Identifier;
3749
var localDecl1 = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
4152
var baseListNode = root.
DescendantNodes
().OfType<BaseListSyntax>().Single();
4310
var localDeclaration = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
Diagnostics\GetDiagnosticsTests.cs (3)
782
var localDecl = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
1061
var localDecl = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
1549
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().First();
FieldKeywordTests.cs (3)
1275
var attributeArguments = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Select(arg => arg.Expression).ToArray();
1333
var attributeArguments = tree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Select(arg => arg.Expression).ToArray();
9474
return tree.GetRoot().
DescendantNodes
().OfType<PropertyDeclarationSyntax>().
FirstClassSpanTests.cs (4)
2731
var arg = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
2764
var casts = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToImmutableArray();
4908
var aVariable = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
4911
var d1Access = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>()
FlowAnalysis\FlowTests.cs (1)
5841
var declarations = tree.GetRoot().
DescendantNodes
().OfType<PropertyDeclarationSyntax>().ToImmutableArray();
FlowAnalysis\IterationJumpYieldStatementTests.cs (1)
914
var foreachNode = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
FlowAnalysis\RegionAnalysisTests.cs (15)
5487
var methodBlock = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BlockSyntax>().First();
5488
var foreachStatement = methodBlock.
DescendantNodes
().OfType<ForEachStatementSyntax>().First();
5489
var foreachBlock = foreachStatement.
DescendantNodes
().OfType<BlockSyntax>().First();
5490
var lambdaExpression = methodBlock.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().First();
5491
var lambdaBlock = lambdaExpression.
DescendantNodes
().OfType<BlockSyntax>().First();
5536
var node = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
5580
var node = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
5623
var node = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
6217
var invocation = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
6228
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
6418
var statement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BlockSyntax>().FirstOrDefault();
8099
var expr = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
8127
var expr = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
14121
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
14144
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
OverloadResolutionPriorityTests.cs (8)
443
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
699
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
759
var accesses = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToArray();
807
var creation = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
978
var secondCtor = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Skip(ctorToForce).First();
2220
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
2318
var invocation = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().First();
2490
var symbols = tree.GetRoot().
DescendantNodes
()
RefReadonlyParameterTests.cs (3)
1525
var local = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
7103
var cref = docComment.
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref).Single();
7131
var cref = docComment.
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref).Single();
RefStructInterfacesTests.cs (114)
6628
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
6765
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
6881
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
7013
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
7142
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
7472
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
7575
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
7662
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
7765
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
7881
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
7984
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().First();
8075
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
8175
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
8268
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
8368
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
8441
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
8443
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
8547
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
8647
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
8931
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
9018
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9135
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
9222
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9331
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
9386
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9499
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
9586
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9714
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
9810
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
9935
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
10019
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10150
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
10246
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10347
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
10349
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10442
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
10444
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10542
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
10629
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10739
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
10826
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
10979
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
11066
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().First();
11198
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
11294
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
11422
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
11506
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
11606
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
11701
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
12148
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
12416
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
12661
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
12924
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
13191
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
13453
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
14151
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
14258
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
14492
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
14599
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
14854
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
14965
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().First();
15205
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
15309
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
15553
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
15657
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
15732
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
15734
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
15987
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
16095
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
16758
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
16760
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
16823
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
16825
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
16888
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
16890
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
16972
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
16974
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17060
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17062
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17153
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17155
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17250
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17252
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17334
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17336
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17655
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17762
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
17852
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
17959
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
18075
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
18182
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().First();
18275
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
18379
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
18476
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
18580
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
18652
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
18654
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
18760
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
18864
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19128
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
19199
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19299
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
19370
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19472
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
19527
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19624
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Main").Single();
19695
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19863
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
19966
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test").Single();
19968
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
21238
var lambda = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
21244
var localFunctions = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToArray();
21305
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
21707
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().ToArray();
Semantics\CollectionExpressionTests.cs (51)
201
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
236
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
4809
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
7573
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8296
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8367
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8451
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8536
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
14300
var returnValue = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Last().Expression;
14376
var returnValue = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Last().Expression;
14449
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
14512
var cast = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Last().Expression;
14517
var value = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Last().Expression;
14636
var cast = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Last().Expression;
14641
var value = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Last().Expression;
14719
var nestedCollection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Last();
14808
var nestedCollection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Last();
15146
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
26086
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26212
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26326
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26384
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26455
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26537
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26603
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26664
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26734
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26909
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26974
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "CreateCollection");
27030
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
28693
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
28737
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
28783
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
28827
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
28870
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
28913
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
28952
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Last();
28985
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
29019
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
29072
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
29138
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
29199
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
29275
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
29318
var collections = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
29365
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Last();
32387
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
32482
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
32524
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
32569
var collection = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
33548
var collectionExpression = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().First();
33589
var collectionExpression = tree.GetRoot().
DescendantNodes
().OfType<CollectionExpressionSyntax>().First();
Semantics\InlineArrayTests.cs (16)
2359
var c = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single();
2394
var c = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single();
2428
var c = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "c").Single();
2508
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First();
6033
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First();
6199
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last();
8118
var f = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Last().Left;
8835
var m3 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").Single().Parent;
9203
var m3 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").Single();
10547
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last();
11291
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").Last();
15208
var f = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").ToArray();
16495
var m3 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").First().Parent;
18583
var f = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single().Expression;
18909
var f = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single().Expression;
19246
var collection = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single().Expression;
Semantics\OutVarTests.cs (85)
178
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
386
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
423
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
461
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
499
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
537
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
575
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
622
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
659
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
697
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
737
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
776
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
816
Assert.False(compilation.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
833
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name);
838
return tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>()
854
return tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>()
860
return tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>();
865
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ContextualKind() == SyntaxKind.UnderscoreToken);
870
return tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>()
1279
forStatement.Statement.
DescendantNodes
().OfType<ForStatementSyntax>().Any(f => f.Condition == null))
5313
var node = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First();
5583
var node = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
9702
var d = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "d").Single();
10269
var d = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(id => id.Identifier.ValueText == "d").Single();
11077
var node = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First();
11335
var node = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
17749
var x2Decl = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
18444
var initializer = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
21367
var e = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "e").Single();
32184
var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single());
32224
var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single());
32264
var a = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "a").Single());
32337
var bDecl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single();
32435
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>()
32458
var one = node0.
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
32473
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>()
33458
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "x").Single();
33646
var z1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "z1").First();
34281
var method = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ElementAt(i + 2);
34282
var rankSpecifierOld = method.
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().Single();
34495
var method = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ElementAt(i + 2);
34496
var rankSpecifierOld = method.
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().Single();
35131
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35170
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35214
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35245
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35284
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35316
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35352
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35391
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35421
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35458
var varType = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35620
var identifierAfter = statementAfter.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "G");
35649
var foreachStatement = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
35804
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
35850
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
35934
var initializerSyntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
35953
var blockBodySyntax = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().First();
35978
var expressionBodySyntax = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().First();
36001
var declarationSyntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
36074
var expressionBodySyntax = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().First();
36098
var blockBodySyntax = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().First();
36122
var propertyExpressionBodySyntax = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().ElementAt(1);
36127
var declarationSyntax = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
36182
var node3 = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().First();
36275
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test3").Last();
36315
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36318
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
36323
Assert.True(model.TryGetSpeculativeSemanticModel(method.Body.SpanStart + 1, method.
DescendantNodes
().OfType<AttributeSyntax>().Single(), out speculativeModel));
36361
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36364
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Skip(1).First();
36368
Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
36401
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36404
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
36409
var equalsValue = method.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
36443
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36446
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
36450
Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
36478
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36481
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
36486
var equalsValue = method.
DescendantNodes
().OfType<ParameterSyntax>().Single()
36487
.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
36516
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
36519
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
36523
Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
Semantics\ParamsCollectionTests.cs (22)
119
var nodes = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Take(3).ToArray();
218
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
334
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
517
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
662
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
1406
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
2530
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
2666
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
2757
var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single());
2791
parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single());
2955
var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single());
2986
parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single());
3596
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
3886
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Test1").Single();
4340
var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().First());
4346
parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Skip(1).First());
5893
var f1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").Single();
5895
var f2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F2").Single();
5975
var f1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").Single();
5977
var f2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F2").Single();
9072
var parameterDecl = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "paramsParameter").Single();
12533
var node = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
Semantics\PatternMatchingTestBase.cs (6)
37
return tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Parent.Kind() == SyntaxKind.DeclarationPattern || p.Parent.Kind() == SyntaxKind.VarPattern);
47
return tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
52
return tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>();
62
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == name);
419
Assert.Empty(tree.GetRoot().
DescendantNodes
().OfType<GlobalStatementSyntax>());
450
var node = tree.GetRoot().
DescendantNodes
().OfType<T>().ElementAt(index);
Semantics\PatternMatchingTests.cs (37)
849
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single();
1432
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
1433
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
1482
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
1483
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
1591
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
1592
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
1656
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
1657
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
1662
var x2Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray();
1663
var x2Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray();
1668
var x3Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").ToArray();
1669
var x3Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray();
1739
var x2Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray();
1740
var x2Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray();
1745
var x3Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").ToArray();
1746
var x3Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray();
2702
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
2703
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
2747
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
2748
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
2791
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
2792
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
2843
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
2844
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
3040
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
3041
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
3087
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
3088
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
3265
foreach (var isExpression in tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>())
3445
var declaration = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
3577
var node = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().First();
6573
var caseDefault = tree.GetRoot().
DescendantNodes
().OfType<CasePatternSwitchLabelSyntax>().First();
11365
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
11389
var locals = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
11410
var syntax = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().Single();
11467
var syntax = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().Single();
Semantics\PatternMatchingTests_ListPatterns.cs (11)
3319
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
3324
var localDeclarations = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
3618
var nodes = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>();
3675
var nodes = tree.GetRoot().
DescendantNodes
()
3720
var designations = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
4085
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
4172
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
4249
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
4363
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
4405
var nodes = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>();
4556
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VarPatternSyntax>().ToArray();
Semantics\PatternMatchingTests_Scope.cs (73)
678
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
679
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single();
713
tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart,
719
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
720
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
947
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
948
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single();
982
tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart,
988
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
989
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
2222
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray();
2358
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray();
2421
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray();
2486
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single();
2556
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).Single();
2712
var yRef = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(name => name.Identifier.ValueText == id).ToArray();
6525
var d = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "d").Single();
6590
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
6591
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single();
6594
var x4Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single();
6595
var x4Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray();
6601
var x6Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x6").Single();
6602
var x6Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x6").Single();
6605
var x8Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").Single();
6606
var x8Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray();
6610
var x14Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x14").ToArray();
6611
var x14Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x14").Single();
6679
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
6680
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single();
6683
var x4Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single();
6684
var x4Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray();
6690
var x6Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x6").Single();
6691
var x6Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x6").Single();
6694
var x8Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").Single();
6695
var x8Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray();
6699
var x14Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x14").ToArray();
6700
var x14Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x14").Single();
6838
var x2Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").ToArray();
6839
var x2Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").ToArray();
6845
var x3Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").Single();
6846
var x3Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").ToArray();
6850
var x4Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single();
6851
var x4Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray();
6884
bool success = model.TryGetSpeculativeSemanticModel(tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, statement, out model);
6930
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
6931
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
6936
var d = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(id => id.Identifier.ValueText == "d").Single();
10589
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").ToArray();
10590
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
10597
var x2Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x2").Single();
10598
var x2Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x2").Single();
10601
var x3Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x3").Single();
10602
var x3Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x3").Single();
10605
var x4Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x4").Single();
10606
var x4Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x4").ToArray();
10612
var x5Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x5").Single();
10613
var x5Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x5").ToArray();
10617
var x8Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x8").ToArray();
10618
var x8Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x8").ToArray();
10627
var x9Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x9").Single();
10628
var x9Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x9").Single();
10631
var x10Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x10").Single();
10632
var x10Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x10").Single();
10635
var x11Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x11").Single();
10636
var x11Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x11").ToArray();
10640
var x12Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x12").Single();
10641
var x12Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x12").ToArray();
10685
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
10686
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").Single();
10720
tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart,
10726
var x1Decl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(p => p.Identifier.ValueText == "x1").Single();
10727
var x1Ref = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x1").ToArray();
12211
var e = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "e").Single();
Semantics\PatternMatchingTests2.cs (5)
720
foreach (var designation in tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>())
727
foreach (var ident in tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>())
2020
var returnStatement = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single();
2061
var returnStatement = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single();
2881
var switches = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().ToArray();
Semantics\PatternMatchingTests3.cs (12)
49
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
109
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
160
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
205
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
256
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
299
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
346
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
1611
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
1889
var strDecl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(s => s.Identifier.ValueText == "str").ToArray();
1893
var arrDecl = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Where(s => s.Identifier.ValueText == "arr").ToArray();
4107
var patterns = tree.GetRoot().
DescendantNodes
().OfType<PatternSyntax>().ToArray();
4334
var patterns = tree.GetRoot().
DescendantNodes
().OfType<PatternSyntax>().ToArray();
Semantics\PatternMatchingTests4.cs (13)
1010
var dpcss = tree.GetRoot().
DescendantNodes
().OfType<PositionalPatternClauseSyntax>().ToArray();
4017
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchStatementSyntax>().Single();
4086
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchStatementSyntax>().Single();
4159
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchStatementSyntax>().Single();
4231
var @is = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
4275
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4322
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4404
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4486
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4568
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4650
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4734
var @switch = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single();
4828
var x = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().First();
Semantics\PatternMatchingTests5.cs (9)
427
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
564
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
795
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
841
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
895
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
1106
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
1186
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
1237
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
1289
var subpatterns = tree.GetRoot().
DescendantNodes
().OfType<SubpatternSyntax>().ToArray();
Semantics\PatternSwitchTests.cs (6)
1515
var sRef = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "s").Single();
1517
var iRef = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "i").Single();
1519
var s2Ref = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "s2").Single();
1521
var i2Ref = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "i2").Single();
3252
var node = tree.GetRoot().
DescendantNodes
()
3283
var node = tree.GetRoot().
DescendantNodes
()
Semantics\PrimaryConstructorTests.cs (50)
420
var parameters = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().ToArray();
961
var outVarSyntax = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Single();
1003
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
1072
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
1085
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
1184
var equalsValue = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First();
1194
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
1220
var equalsValue = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Last();
1300
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
1311
var y = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First();
1324
var test = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First();
1365
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
1411
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
1422
var classDeclarations = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Skip(1).ToArray();
1467
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
1483
var classDeclarations = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Skip(1).ToArray();
1526
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
1551
var classDeclarations = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Skip(1).ToArray();
1615
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
1640
var classDeclarations = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Skip(1).ToArray();
1814
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
1854
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
1897
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
1967
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
2118
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
2173
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart,
2217
Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart,
2221
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
2300
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
2325
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart,
2356
Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart,
2360
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
2425
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2474
tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().First();
2484
tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First();
2489
var baseWithoutParens = tree.GetRoot().
DescendantNodes
().OfType<SimpleBaseTypeSyntax>().Single();
2641
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2652
var typeDeclaration = tree.GetRoot().
DescendantNodes
().OfType<TypeDeclarationSyntax>().Single();
2679
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2716
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2752
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
6091
var x = doc.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
6832
var xReference = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single().ArgumentList.Arguments[0].Expression;
6858
var mCall = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single().ArgumentList.Arguments[0].Expression;
6859
var attrApplication = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single();
6860
var mDefinition = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
7794
var p1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").Single();
8756
var p1s = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").ToArray();
9162
var p1s = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "p1").ToArray();
19772
var indexer = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
Semantics\RecordTests.cs (58)
282
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
448
var parameterSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
454
var initializerSyntax = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
480
var outVarSyntax = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Single();
1816
var main = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
2489
var x = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Last().Left;
8091
var withExpr1 = root.
DescendantNodes
().OfType<WithExpressionSyntax>().First();
8130
var main = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
8603
var withExpr = root.
DescendantNodes
().OfType<WithExpressionSyntax>().Single();
8610
var xId = withExpr.
DescendantNodes
().Single(id => id.ToString() == "X");
8630
var main = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
8717
var withExpr = root.
DescendantNodes
().OfType<WithExpressionSyntax>().Single();
8735
var main = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
8865
var withExpr1 = root.
DescendantNodes
().OfType<WithExpressionSyntax>().First();
8878
var withExpr2 = root.
DescendantNodes
().OfType<WithExpressionSyntax>().Skip(1).Single();
21144
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
21157
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
21257
var equalsValue = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First();
21268
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
21294
var equalsValue = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Last();
21374
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
21385
var y = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First();
21398
var test = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First();
21439
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
21485
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
21496
var recordDeclarations = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Skip(1).ToArray();
21541
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
21557
var recordDeclarations = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Skip(1).ToArray();
21600
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
21625
var recordDeclarations = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Skip(1).ToArray();
21689
var xs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ToArray();
21714
var recordDeclarations = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Skip(1).ToArray();
21888
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
21925
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
21965
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
22000
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
22079
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").ElementAt(1);
22230
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
22285
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart,
22329
Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart,
22333
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
22412
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single();
22437
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart,
22468
Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart,
22472
var baseWithargs = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
22917
var recordDeclaration = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().First();
23371
var recordDeclaration = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().ElementAt(1);
24643
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
24654
var recordDeclaration = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Single();
24678
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
24712
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
24747
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
28187
var x = doc.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
28344
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
30371
var xReference = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single().ArgumentList.Arguments[0].Expression;
30395
var mCall = tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Single().ArgumentList.Arguments[0].Expression;
30396
var attrApplication = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single();
30397
var mDefinition = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (3)
EndToEndTests.cs (3)
491
var node = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
612
var literals = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
865
var isPattern = tree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.Features (35)
ChangeSignature\CSharpChangeSignatureService.cs (2)
777
.
DescendantNodes
(descendIntoTrivia: true)
820
var identifier = nameAttribute.
DescendantNodes
(descendIntoTrivia: true).OfType<IdentifierNameSyntax>().FirstOrDefault();
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
150
foreach (var node in parentBlock.
DescendantNodes
())
302
foreach (var id in localFunction.
DescendantNodes
().OfType<IdentifierNameSyntax>())
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
390
=> node.
DescendantNodes
(n => n is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax)
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
38
var namespaceDecls = compilationUnit.
DescendantNodes
(n => n is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
312
var designation = leftPattern.
DescendantNodes
()
594
var nodes = editor.OriginalRoot.
DescendantNodes
().Where(IsFixableNode).ToArray();
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
287
var yieldStatementsCount = memberDeclarationSyntax.
DescendantNodes
().OfType<YieldStatementSyntax>()
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
754
if (memberDeclarationNode.
DescendantNodes
().OfType<ReturnStatementSyntax>().Count() == 1)
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (1)
96
var namespaceDecl = root.
DescendantNodes
().OfType<BaseNamespaceDeclarationSyntax>().FirstOrDefault();
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
494
foreach (var descendant in interpolation.
DescendantNodes
().OfType<ExpressionSyntax>())
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
149
var throwExpressionsAndStatements = member.
DescendantNodes
().Where(n => n.Kind() is SyntaxKind.ThrowExpression or SyntaxKind.ThrowStatement);
190
block.
DescendantNodes
().OfType<ThrowStatementSyntax>().Any(t => t.Expression is null))
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
129
.
DescendantNodes
(d => d.Span.IntersectsWith(span))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
427
var declarations = statement.
DescendantNodes
()
Formatting\CSharpNamespaceDeclarationNewDocumentFormattingProvider.cs (1)
47
var declarations = root.
DescendantNodes
().OfType<BaseNamespaceDeclarationSyntax>();
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
386
var localFunctions = innermostCommonBlock.
DescendantNodes
().Where(node => node.IsKind(SyntaxKind.LocalFunctionStatement) && matches.Any(match => match.Span.OverlapsWith(node.Span)));
396
var localFunctionCalls = innermostCommonBlock.
DescendantNodes
().Where(node => node is InvocationExpressionSyntax invocationExpression &&
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
66
var methodDeclarations = root.
DescendantNodes
(n => n is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax or ClassDeclarationSyntax).OfType<MethodDeclarationSyntax>();
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
375
foreach (var descendentNode in enclosingBlockOfLocalStatement.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
118
if (parent.
DescendantNodes
().OfType<StatementSyntax>().Count() <= 1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
191
foreach (var candidate in outermostBody.
DescendantNodes
().OfType<ExpressionSyntax>())
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
56
foreach (var node in propertyDeclaration.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
524
foreach (var identifier in containingBlock.
DescendantNodes
().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
252
foreach (var identifierName in searchScope.
DescendantNodes
().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
245
foreach (var descendentNode in block.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
317
foreach (var descendentNode in _enclosingBlock.
DescendantNodes
())
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
178
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
219
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
240
foreach (var descendentNode in enclosingBlock.
DescendantNodes
())
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
47
var descendentXmlElements = nodeStructure.
DescendantNodes
().OfType<XmlElementSyntax>();
62
.
DescendantNodes
(descendIntoChildren: _ => true, descendIntoTrivia: false)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
400
.
DescendantNodes
(node => node is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
239
parameterList.
DescendantNodes
().OfType<SimpleNameSyntax>(),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (19)
EditAndContinue\SyntaxUtilitiesTests.cs (19)
24
foreach (var oldNode in oldRoot.
DescendantNodes
().Where(n => n.FullSpan.Length > 0))
87
var leftPosition = leftRoot.
DescendantNodes
().OfType<LiteralExpressionSyntax>().ElementAt(2).SpanStart; // 0 within Console.WriteLine(0)
134
var leftPosition = leftRoot.
DescendantNodes
().OfType<LiteralExpressionSyntax>().ElementAt(5).SpanStart; // 3 within Console.WriteLine(3)
184
var m0 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M0");
185
var m1 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M1");
186
var m2 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M2");
187
var m3 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M3");
189
var f1 = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f1");
190
var f2 = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f2");
192
var l1 = m3.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l1").Initializer.
193
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
195
var l2 = m3.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l2").Initializer.
196
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
198
var l3 = m3.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l3").Initializer.
199
DescendantNodes
().OfType<AnonymousFunctionExpressionSyntax>().Single();
252
var x = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "X");
253
var m1 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M1");
254
var m2 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M2");
255
var f = m2.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f");
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (91)
IOperation\IOperationTests.cs (11)
181
var m = comp.SyntaxTrees.Single().GetRoot().
DescendantNodes
().OfType<BlockSyntax>().Single();
260
var m = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().First();
311
var op = (IForLoopOperation)comp.GetSemanticModel(tree).GetOperation(tree.GetRoot().
DescendantNodes
().OfType<ForStatementSyntax>().Single());
352
var m = tree.GetRoot().
DescendantNodes
().OfType<BlockSyntax>().First();
379
var op = (IForEachLoopOperation)comp.GetSemanticModel(tree).GetOperation(tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single());
413
var nodes = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
463
var assignments = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().ToArray();
509
var statement = tree.GetRoot().
DescendantNodes
().OfType<StatementSyntax>().Single();
588
var literal = root.
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
667
var catchBlock = syntaxTree.GetRoot().
DescendantNodes
().OfType<CatchClauseSyntax>().Single();
711
var fieldInitializer = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Last().Value;
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (4)
409
var variableDeclaration = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
489
var variableDeclaration = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
847
var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single()));
902
var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single()));
IOperation\IOperationTests_ICoalesceAssignmentOperation.cs (1)
253
var m = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
IOperation\IOperationTests_ICoalesceOperation.cs (11)
36
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
147
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
262
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
377
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
493
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
606
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
721
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
837
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
951
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
1053
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
1168
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
IOperation\IOperationTests_IConstructorBodyOperation.cs (19)
40
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
67
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
123
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
189
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
257
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
323
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
398
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
487
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
514
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
589
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
651
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
721
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
796
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
865
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
955
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
1072
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
1092
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
1125
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
1163
var node1 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Skip(1).Single();
IOperation\IOperationTests_IConversionExpression.cs (1)
5292
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First();
IOperation\IOperationTests_IFieldReferenceExpression.cs (2)
707
var classDecl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
711
var methodDecl = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
IOperation\IOperationTests_IFixedStatement.cs (1)
693
var expr = tree.GetRoot().
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
IOperation\IOperationTests_ILocalFunctionStatement.cs (2)
1793
var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First()));
1848
var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First()));
IOperation\IOperationTests_IMethodBodyOperation.cs (27)
35
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
56
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
109
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
171
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
243
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
285
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
333
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
400
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
444
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().First();
506
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().First();
562
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
581
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
613
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
657
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
704
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
723
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
755
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
799
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
846
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
865
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
897
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
938
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Single();
978
var node1 = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
1000
var node1 = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
1035
var node1 = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().First();
1080
var node1 = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().First();
1124
var node1 = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
IOperation\IOperationTests_IObjectCreationExpression.cs (6)
782
var m1 = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
1069
var main = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
1295
var m1 = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
1574
var main = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
2276
var m = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
2400
var m = comp.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M");
IOperation\IOperationTests_ISymbolInitializer.cs (1)
33
var nodes = tree.GetRoot().
DescendantNodes
().Where(n => n is VariableDeclarationSyntax || n is PropertyDeclarationSyntax).ToArray();
IOperation\IOperationTests_IVariableDeclaration.cs (5)
925
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1215
var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().First();
2301
var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().First();
2362
var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().First();
2830
var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().First();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1284)
Semantics\AccessCheckTests.cs (4)
743
IAliasSymbol aliasA = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Where(u => u.Alias != null).Single()) as IAliasSymbol;
761
var discards = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ContextualKind() == SyntaxKind.UnderscoreToken).ToArray();
897
IAliasSymbol SomeAlias = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Where(u => u.Alias != null).Single());
911
IMethodSymbol IntegerPlus = model.GetSymbolInfo(tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single()).Symbol as IMethodSymbol;
Semantics\AnonymousFunctionTests.cs (6)
983
var anonymousMethodSyntax = root.
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
984
var simpleLambdaSyntax = root.
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single();
985
var parenthesizedLambdaSyntax = root.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
1017
var anonymousMethodSyntax = root.
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
1018
var simpleLambdaSyntax = root.
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single();
1019
var parenthesizedLambdaSyntax = root.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
Semantics\AwaitExpressionTests.cs (2)
84
var awaitExpression = tree.GetRoot().
DescendantNodes
().OfType<AwaitExpressionSyntax>().First();
273
var decl = compilation.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().AsSingleton();
Semantics\BetterCandidates.cs (4)
1087
var invocations = compilation.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1164
var invocations = compilation.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1212
var invocations = compilation.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1265
var invocations = compilation.SyntaxTrees[0].GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
Semantics\BindingAsyncTests.cs (3)
58
var simple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single();
61
var parens = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>();
87
var del = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
Semantics\BindingTests.cs (27)
2365
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.ThisExpression)).Cast<ThisExpressionSyntax>().Single();
2384
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.ThisExpression)).Cast<ThisExpressionSyntax>().Single();
2724
.
DescendantNodes
()
2736
.
DescendantNodes
()
2780
.
DescendantNodes
()
2835
.
DescendantNodes
()
2847
.
DescendantNodes
()
2888
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single();
2925
var lambda = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single();
2931
var id = lambda.
DescendantNodes
().First(n => n.IsKind(SyntaxKind.IdentifierName));
2967
var lambda = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single();
2973
var id = lambda.
DescendantNodes
().First(n => n.IsKind(SyntaxKind.IdentifierName));
3037
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent;
3051
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent;
3117
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent;
3131
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent;
3190
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent;
3205
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent;
3275
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent;
3290
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent;
3380
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "MathMin").Single().Parent;
3732
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "E").Single().Parent;
3912
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "G").First();
3939
var lambda = tree.GetRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single(s => s.Parameter.Identifier.Text == "x");
3985
var ids = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().ToArray();
4026
var ids = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().ToArray();
4038
var ifStmt = tree.GetRoot().
DescendantNodes
().OfType<IfStatementSyntax>().First();
Semantics\ColorColorTests.cs (9)
1817
var memberAccess = syntaxRoot.
DescendantNodes
().Single(node => node.IsKind(SyntaxKind.SimpleMemberAccessExpression)) as MemberAccessExpressionSyntax;
1882
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
1892
var node2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single();
1939
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
1949
var node2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single();
1996
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
2006
var node2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single();
2046
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
2055
var node2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.Text == "E" && (n.Parent is EqualsValueClauseSyntax)).Single();
Semantics\ConditionalOperatorTests.cs (3)
1346
var memberBinding = tree.GetRoot().
DescendantNodes
().OfType<MemberBindingExpressionSyntax>().Single();
1400
var memberBinding = tree.GetRoot().
DescendantNodes
().OfType<MemberBindingExpressionSyntax>().Single();
1447
var memberBinding = tree.GetRoot().
DescendantNodes
().OfType<MemberBindingExpressionSyntax>().Single();
Semantics\ConstantTests.cs (2)
2923
var expr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
3521
var initializer = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
Semantics\DeconstructionTests.cs (46)
1839
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3765
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3943
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4169
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
4171
var refs = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>();
4237
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
4256
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4314
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
4372
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
4391
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4445
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
4507
foreach (var designation in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>())
4515
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4579
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
4665
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4722
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4759
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4837
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
4942
var declaration = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
4988
var declaration = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
5046
var declaration = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
5130
Assert.False(tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Any());
5186
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
5205
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5259
var tuples = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ToArray();
5330
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
5349
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5403
var tuples = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ToArray();
5478
foreach (var designation in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>())
5486
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5546
var tuples = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ToArray();
5654
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
5673
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5709
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
5764
var designations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
5783
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5819
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
5878
foreach (var designation in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>())
5886
var declarations = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5925
var tuple = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
5986
var mainCall = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6029
var mainCall = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6069
var mainCall = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6111
var two = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "2").Single();
6151
var mainCall = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6554
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
Semantics\DelegateTypeTests.cs (35)
749
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
795
var expr = ((CastExpressionSyntax)tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value).Expression;
895
var expr = tree.GetRoot().
DescendantNodes
().OfType<AnonymousFunctionExpressionSyntax>().Single();
938
var expr = ((CastExpressionSyntax)tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value).Expression;
996
var expr = tree.GetRoot().
DescendantNodes
().OfType<AnonymousFunctionExpressionSyntax>().Single();
1036
var expr = ((CastExpressionSyntax)tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value).Expression;
1211
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1247
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1332
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1372
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1415
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1459
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1554
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1634
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1684
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1734
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1784
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1834
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1884
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1934
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
1980
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
2028
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
3603
var exprs = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToArray();
8028
var expr = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer!.Value;
8051
var expr = tree.GetRoot().
DescendantNodes
().OfType<AnonymousFunctionExpressionSyntax>().Single();
10386
var variables = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Initializer != null);
11084
var nodes = tree.GetRoot().
DescendantNodes
();
11170
var variables = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text == "d").ToArray();
12110
var syntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
14700
var syntax = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
14745
var expr = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
19760
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
19768
typeInfo = model.GetTypeInfo(declarator.Initializer!.Value.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single());
19802
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
19810
typeInfo = model.GetTypeInfo(declarator.Initializer!.Value.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single());
Semantics\DynamicTests.cs (186)
3860
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single();
3893
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single();
3921
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single();
3949
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single();
4000
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Goo").Single();
4976
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
4985
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5059
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5100
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5109
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5182
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5223
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5232
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5306
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5341
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5346
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5382
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5387
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5426
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5431
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5470
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5475
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5514
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5519
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5578
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
5616
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
5655
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "e").Single();
5691
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5696
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5732
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5737
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5777
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5782
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5822
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5827
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5867
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
5872
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5935
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
5974
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6022
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6031
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6104
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6145
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6154
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6227
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6265
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6274
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6347
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6377
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6382
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6419
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6424
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6466
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6471
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6510
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
6515
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6552
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6559
foreach (var elementAccess in tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>())
6571
var increment = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
6606
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6613
foreach (var elementAccess in tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>())
6671
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6680
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6736
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6780
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6789
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6845
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6890
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6899
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
6956
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6991
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
6996
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7059
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7068
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7118
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7162
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7171
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7230
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7275
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7284
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7346
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7391
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7400
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7463
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7504
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7513
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7581
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7590
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7642
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7686
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7695
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7748
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7792
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7801
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7854
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7895
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7905
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
7967
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
7976
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8029
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8073
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8082
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8135
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8178
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8187
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8239
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8283
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8292
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8348
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8392
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8401
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8457
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8501
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8510
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8566
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8611
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8620
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8677
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8724
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8729
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8793
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8798
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8861
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
8870
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8926
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9016
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9107
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9197
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9253
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9314
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9435
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9555
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9669
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9780
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
9891
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
10009
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10014
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10022
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10092
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10137
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10142
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10150
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10220
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10265
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10270
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10278
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10348
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10419
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10424
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10432
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10500
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10553
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10558
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10566
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10647
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10701
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10706
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10714
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
10797
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10971
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First();
10976
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
10984
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11063
node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Item1").Single();
11100
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
11105
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11184
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
11189
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11262
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
11267
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11317
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11326
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11370
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11379
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11419
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11450
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11455
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11494
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11499
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11535
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11540
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
11584
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11593
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11636
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11645
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11680
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "result").Single();
11685
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
Semantics\ExpressionBodiedMemberTests.cs (23)
42
.
DescendantNodes
()
426
var node = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
475
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
506
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
535
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
540
Assert.Contains("P1", model.LookupNames(tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single().Body.Position));
542
var node2 = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single()
543
.Body.
DescendantNodes
().OfType<AssignmentExpressionSyntax>()
575
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
580
Assert.Contains("P1", model.LookupNames(tree.GetRoot().
DescendantNodes
().OfType<DestructorDeclarationSyntax>().Single().Body.Position));
582
var node2 = tree.GetRoot().
DescendantNodes
().OfType<DestructorDeclarationSyntax>().Single()
583
.Body.
DescendantNodes
().OfType<AssignmentExpressionSyntax>()
616
Assert.Equal(1, tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Count());
649
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
680
var node = tree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
711
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
742
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
777
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
808
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
839
var nodes = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>();
874
var nodes = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>();
913
var nodes = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>();
1021
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
Semantics\ForEachTests.cs (6)
2129
var loopSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
2181
var loopSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
2885
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3326
var loop = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3360
var loop = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3421
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.Kind() == SyntaxKind.ForEachStatement).OfType<ForEachStatementSyntax>().Single();
Semantics\FunctionPointerTests.cs (50)
201
var initializer1 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First().Initializer!.Value;
203
var parameter = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First().ArgumentList.Arguments.Single();
205
var initializer2 = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Last().Initializer!.Value;
293
foreach (var literal in tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(v => v.Initializer!.Value))
351
var conversions = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToList();
402
var conversions = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToList();
454
var conversions = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToList();
502
var conversions = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToList();
600
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToList();
839
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => d.Initializer!.Value).ToList();
882
var variableDeclaratorSyntax = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
942
var variableDeclaratorSyntax = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
978
var variableDeclaratorSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1046
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1126
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1271
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1366
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1507
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1564
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1615
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1662
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1695
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1728
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1775
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1822
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1855
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1888
var m1Invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
1936
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
2054
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
2088
var localSyntax = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
2226
.
DescendantNodes
()
2283
.
DescendantNodes
()
2356
.
DescendantNodes
()
2430
.
DescendantNodes
()
2498
.
DescendantNodes
()
2595
.
DescendantNodes
()
2668
.
DescendantNodes
()
3178
var invocations = tree.GetRoot().
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().ToList();
3297
var invocations = tree.GetRoot().
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().ToList();
3376
var isPatterns = syntaxTree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().ToArray();
3433
var isPattern = syntaxTree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
3475
var isPattern = syntaxTree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
3528
var binaryExpressions = syntaxTree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().ToArray();
3582
var isPattern = syntaxTree.GetRoot().
DescendantNodes
().OfType<IsPatternExpressionSyntax>().Single();
3583
var funcPtrTypeSyntax = isPattern.
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single();
3677
var paramTypes = syntaxTree.GetRoot().
DescendantNodes
()
3805
VariableDeclarationSyntax fieldDeclaration = syntaxTree.GetRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Single().Declaration;
3815
.
DescendantNodes
()
3817
.Single().
DescendantNodes
()
3949
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
Semantics\FuzzTests.cs (1)
53
foreach (var node in tree.GetRoot().
DescendantNodes
())
Semantics\GenericConstraintsTests.cs (4)
3140
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
3170
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
3196
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
3225
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
Semantics\GlobalUsingDirectiveTests.cs (42)
3842
var ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3844
var aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3868
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3870
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3890
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3899
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3901
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3918
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3932
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3934
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3952
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3954
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3968
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3977
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
3979
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3990
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4004
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4006
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4024
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4026
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4040
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4049
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4051
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4062
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4076
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4078
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4090
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4092
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4100
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4111
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4113
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4133
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4135
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4149
ext = tree.GetRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().ToArray();
4151
aliases = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
4243
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4251
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4279
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4287
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4295
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4303
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
4315
node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
Semantics\ImplicitObjectCreationTests.cs (23)
56
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
131
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
178
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
228
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
842
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
883
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
1706
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1866
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1896
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1926
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1978
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2036
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2071
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2125
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
2217
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2514
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2565
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2922
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().ToArray();
3215
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
4157
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
4184
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExpressionStatementSyntax>().Single();
4531
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
4574
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "aParameter").Single();
Semantics\IndexAndRangeTests.cs (9)
898
var expression = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
918
var expression = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
939
var expression = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
1122
var expressions = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ToArray();
1251
var expression = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ElementAt(1);
1284
var expression = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ElementAt(2);
1317
var expression = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ElementAt(3);
1341
var expressions = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ToArray();
1384
var expressions = tree.GetRoot().
DescendantNodes
().OfType<RangeExpressionSyntax>().ToArray();
Semantics\InitOnlyMemberTests.cs (6)
2521
var invocation = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
3140
AccessorDeclarationSyntax accessorDecl = root.
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
3154
.
DescendantNodes
()
3192
var nodes = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>();
4143
var localFunctionSyntax = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
4148
var delegateSyntax = tree.GetRoot().
DescendantNodes
().OfType<DelegateDeclarationSyntax>().Single();
Semantics\InteractiveUsingTests.cs (2)
87
var syntax = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
117
var syntax = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
Semantics\InterceptorsTests.cs (30)
164
var invocation = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1874
var invocation = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1976
var node1 = root.
DescendantNodes
().First(node => node is IdentifierNameSyntax name && name.Identifier.Text == "Prop");
1979
var node2 = root.
DescendantNodes
().Single(node => node is ObjectCreationExpressionSyntax);
1982
var node3 = root.
DescendantNodes
().Last(node => node is IdentifierNameSyntax name && name.Identifier.Text == "Program");
2152
var invocation = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
3277
var interceptableName = sourceTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last().GetInterceptableNameSyntax()!;
5674
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
6811
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
6861
if (tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList() is not [var node, var otherNode])
7013
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7054
var node = sourceTree1.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7100
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7146
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7197
var node = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7222
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7268
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
7309
var node = source.GetRoot().
DescendantNodes
().OfType<MemberBindingExpressionSyntax>().Single();
7350
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
7394
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
7437
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7490
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7536
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7595
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7655
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7710
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7765
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7815
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
7873
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single(i => i.ToString() == "RS().M()");
7937
var node = source.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single(i => i.ToString() == "new S().M()");
Semantics\InterpolationTests.cs (3)
4599
var descendentNodes = tree.GetRoot().
DescendantNodes
();
4602
.Where(b => b.
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().Any())
4825
SyntaxNode syntax = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
Semantics\IteratorTests.cs (5)
458
var yieldNode = (YieldStatementSyntax)tree.GetRoot().
DescendantNodes
().Where(n => n is YieldStatementSyntax).SingleOrDefault();
481
var yieldNode = (YieldStatementSyntax)tree.GetRoot().
DescendantNodes
().Where(n => n is YieldStatementSyntax).SingleOrDefault();
578
var node = tree.GetRoot().
DescendantNodes
().OfType<YieldStatementSyntax>().First();
609
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
647
var node = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
Semantics\LambdaDiscardParametersTests.cs (8)
68
var underscores = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Where(p => p.Identifier.ToString() == "_").ToArray();
386
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>();
417
var underscoreParameters = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray();
422
var underscore = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").Single();
448
var underscores = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").ToArray();
482
var underscore = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").Single();
513
var underscores = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(p => p.ToString() == "_").ToArray();
566
var underscoreParameters = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray();
Semantics\LambdaTests.cs (77)
841
ExpressionSyntax expr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().
849
var exprs = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>();
941
var invocation = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1035
.
DescendantNodes
()
1089
.
DescendantNodes
()
1124
.
DescendantNodes
()
1178
var expr = (ExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single().Body;
1206
var expr = (ExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
1238
var expr = (ExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single().Body;
1513
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
1548
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
1582
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
1614
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").Single();
1979
var node1 = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.AnonymousMethodExpression)).Single();
2120
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2121
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2166
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2167
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2212
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2213
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2258
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2259
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2304
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2305
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2334
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2335
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2361
var lambda = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
2362
var eReference = lambda.Body.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
2415
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2461
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2507
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2540
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2573
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2610
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
2662
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().ToArray();
2997
ExpressionSyntax contentType = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ContentType").Single();
3004
ExpressionSyntax b = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b").Single();
3013
ParameterSyntax parameterSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
3039
ExpressionSyntax contentType = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ContentType").Single();
3046
ExpressionSyntax b = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b").Single();
3054
ParameterSyntax parameterSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
3612
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>();
3893
var lambda = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3937
var attributeSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().ToImmutableArray();
3977
var a = (IdentifierNameSyntax)tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single().Name;
3986
var m = newTree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
3990
a = (IdentifierNameSyntax)newTree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single().Name;
4093
var expr = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
4122
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4157
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4185
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4212
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4787
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4872
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4927
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4954
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
4982
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
5028
var expr = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
5636
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
6509
var parameterUsages = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
6819
var discard = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
6848
var underscore = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
6897
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
7011
var action = syntaxTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First(id => id.Identifier.ValueText == "Action");
7108
var lambdas = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToArray();
8010
var lambdas = tree.GetRoot().
DescendantNodes
()
8058
var lambda = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
8059
var equalsValue = lambda.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
8087
var newLambda = newMethod.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
8118
var decls = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().ToImmutableArray();
8126
var defaultValue = decls[1].
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single()
8127
.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single().Value;
8132
var lhs = decls[2].
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single().Value;
8157
var defaultValue = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single()
8158
.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single().Value;
8360
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
8393
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().ToImmutableArray();
Semantics\LocalFunctionTests.cs (48)
349
.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
353
var x = newTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
394
var a = tree.GetRoot().
DescendantNodes
()
405
.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
409
a = newTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().ElementAt(2);
451
var attributeSyntax = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single();
493
var localFunction = tree.GetRoot().
DescendantNodes
()
541
var localFunction = tree.GetRoot().
DescendantNodes
()
805
var localFunction = tree.GetRoot().
DescendantNodes
()
852
var localFunction = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
968
var localFunction = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
1022
var attributeSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().ToList();
1060
var attrSyntax = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single();
1720
var x = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.ValueText == "x").Single();
1767
var a = root.
DescendantNodes
()
1785
var clsCompliant = root.
DescendantNodes
()
1842
var a = root.
DescendantNodes
()
1860
var clsCompliant = root.
DescendantNodes
()
2373
LocalFunctionStatementSyntax declaration = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().First();
2587
var exprs = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToImmutableArray();
4686
var descendents = tree.GetRoot().
DescendantNodes
();
4724
var descendents = tree.GetRoot().
DescendantNodes
();
4962
var b2 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b2").Single();
4965
var b1 = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "b1").Single();
6489
var exprs = tree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray();
6536
var exprs = tree.GetRoot().
DescendantNodes
().OfType<SizeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray();
6550
return tree.GetRoot().
DescendantNodes
().
7038
var nodes = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>();
7098
var nodes = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
7360
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
7383
return node.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "TParameter").Single();
7451
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == identifier).Single().SpanStart;
7455
=> SyntaxFactory.ParseCompilationUnit($@"{source};", options: parseOptions).
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7458
=> SyntaxFactory.ParseCompilationUnit($@"{source};", options: parseOptions).
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
7532
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
7585
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
7639
var tParameterUsages = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
8684
var parameterUsages = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
8739
var method = tree2.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
8742
var invocation = tree2.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
8779
var nameofExpression = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
8941
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
8964
return node.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "parameter").Single();
9445
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
9552
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
9763
=> SyntaxFactory.ParseCompilationUnit($@"class X {{ {source} void M() {{ }} }}", options: parseOptions).
DescendantNodes
().OfType<AttributeSyntax>().Single();
10172
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>()
10385
var localFunction = root.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
Semantics\LockTests.cs (9)
45
var localDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
50
var lockStatement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LockStatementSyntax>().Single();
55
var memberAccessExpression = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
489
var lockStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LockStatementSyntax>().ToList();
550
var localDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TypeParameterSyntax>().Single();
575
var lockStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LockStatementSyntax>().ToList();
604
var localDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
628
var localDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
699
var lockStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LockStatementSyntax>().ToList();
Semantics\LookupTests.cs (9)
1501
var node = tree.GetRoot().
DescendantNodes
().OfType<ExpressionSyntax>().Where(n => n.ToString() == "m.M").Single();
1643
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "returne<double>").First();
1670
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "System.Object").First();
1725
var syntaxes = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToArray();
2014
var call = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
2044
var node = tree.GetRoot().
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().Single().Expression;
2074
var node = tree.GetRoot().
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().Single().Expression;
2100
var node = tree.GetRoot().
DescendantNodes
().OfType<GenericNameSyntax>().Single();
2122
var node = tree.GetRoot().
DescendantNodes
().OfType<AttributeSyntax>().Single();
Semantics\MethodTypeInferenceTests.cs (4)
859
return tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>();
864
return tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ContextualKind() == SyntaxKind.UnderscoreToken);
1047
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1077
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
Semantics\NameOfTests.cs (17)
692
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First();
718
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First();
753
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
800
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
837
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
873
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "a.Nested").OfType<ExpressionSyntax>().First();
919
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "A.Extension").OfType<ExpressionSyntax>().First();
952
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
984
var initializer = tree2.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
1024
return tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>()
1056
var initializer = tree2.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
1098
return tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>()
1138
var initializer = tree2.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
1181
return tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>()
1219
var initializer = tree2.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
1262
return tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>()
1429
var node = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "X1.Extension").OfType<ExpressionSyntax>().First();
Semantics\NativeIntegerTests.cs (18)
1789
var actualLocals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
2346
var actualLocals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
2466
var actualLocals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
3634
var nodes = tree.GetRoot().
DescendantNodes
().ToArray();
4118
var nodes = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().ToArray();
6061
var nodes = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>();
6109
var nodes = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>();
9495
var expr = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
9730
var expr = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
10107
var expr = tree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == kind);
10332
var expr = tree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == kind);
12381
var expr = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
15317
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
15338
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
15361
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
15389
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
15412
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
15442
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
Semantics\NonTrailingNamedArgumentsTests.cs (15)
45
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
367
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
393
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
423
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
455
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
484
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
534
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
569
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
598
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
652
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
679
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
710
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
744
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
776
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
983
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
Semantics\NullableContextTests.cs (17)
67
var classDeclPosition = syntaxTree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single().SpanStart;
68
var methodDeclPosition = syntaxTree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single().SpanStart;
102
var classDecl1 = syntaxTree1.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single().SpanStart;
103
var classDecl2 = syntaxTree2.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single().SpanStart;
350
var syntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Skip(1).Single();
389
var syntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Single();
424
var syntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First().Value;
579
var syntaxNodes = tree.GetRoot().
DescendantNodes
();
731
var methodDeclarations = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ToArray();
1771
var returnStatements = syntaxTree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().ToArray();
1841
var syntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single().Right;
1878
var attributeArguments = syntaxTree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().ToArray();
1927
var attributeArguments = syntaxTree.GetRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().ToArray();
1969
var equalsValueClauses = syntaxTree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().ToArray();
2009
var declarations = syntaxTree.GetRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Select(f => f.Declaration.Variables[0]).ToArray();
2048
var declarations = syntaxTree.GetRoot().
DescendantNodes
().OfType<PropertyDeclarationSyntax>().ToArray();
2228
var typeOf = syntaxTree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
Semantics\NullableConversionTests.cs (1)
804
var target = syntaxTree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().ToList()[2];
Semantics\NullableReferenceTypesTests.cs (143)
1754
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().First();
1788
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().First();
1841
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
1867
var suppressions = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().ToArray();
1892
var suppressions = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().ToArray();
1963
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().First();
2276
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
2315
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
2347
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
2381
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Single();
2479
var suppression = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().First();
3334
foreach (var lambda in tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>())
3693
var lambda = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single();
3699
var id = lambda.
DescendantNodes
().First(n => n.IsKind(SyntaxKind.IdentifierName));
4526
var firstCref = tree.GetRoot().
DescendantNodes
(descendIntoTrivia: true).OfType<NameMemberCrefSyntax>().First();
4530
var lastCref = tree.GetRoot().
DescendantNodes
(descendIntoTrivia: true).OfType<NameMemberCrefSyntax>().Last();
4562
var lastCref = tree.GetRoot().
DescendantNodes
(descendIntoTrivia: true).OfType<NameMemberCrefSyntax>().Last();
4594
var lastCref = tree.GetRoot().
DescendantNodes
(descendIntoTrivia: true).OfType<NameMemberCrefSyntax>().Last();
5169
var declaration = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
7769
var specifier = tree.GetRoot().
DescendantNodes
().OfType<ArrayRankSpecifierSyntax>().Single();
10534
var foreachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
13511
var returnStatement = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Skip(1).Single();
34983
var outVar = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
35000
var varDecl = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Where(d => d.Declaration.Type.IsVar).Single();
56076
var nullNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56082
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56106
var nullNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56112
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<ImplicitArrayCreationExpressionSyntax>().Single();
56139
var defaultNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56145
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56176
var defaultNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56182
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56212
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56246
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56277
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56304
var nullNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56310
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56344
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56378
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56409
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56437
var newNode = tree.GetRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().First();
56442
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56472
var newNode = tree.GetRoot().
DescendantNodes
().OfType<ImplicitObjectCreationExpressionSyntax>().First();
56477
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56508
var nullNode = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().First();
56513
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
56588
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
56591
var invocationNode2 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
56619
var lambdaNode = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Last();
56624
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
59017
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59022
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclarationSyntax>().First();
59051
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59079
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59111
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59140
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59173
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59205
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59238
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Skip(1).First();
59272
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Skip(1).First();
59298
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59327
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
59356
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
62841
var declarators = syntaxTree.GetRoot().
DescendantNodes
().OfType<AnonymousObjectMemberDeclaratorSyntax>().ToImmutableArray();
65890
var function1 = tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Last();
65894
var function2 = tree2.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
65899
var object2 = tree2.GetRoot().
DescendantNodes
().OfType<PredefinedTypeSyntax>()
71252
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71288
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71329
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71366
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71403
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71438
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71471
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71508
var declarators = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
71780
var discards = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Select(a => a.Left).ToArray();
71874
var arguments = tree.GetRoot().
DescendantNodes
().OfType<ArgumentSyntax>();
71921
var arguments = tree.GetRoot().
DescendantNodes
().OfType<ArgumentSyntax>();
71960
var discardPatterns = tree.GetRoot().
DescendantNodes
().OfType<DiscardPatternSyntax>().ToArray();
73763
var node = tree.GetRoot().
DescendantNodes
().OfType<EnumMemberDeclarationSyntax>().ElementAt(1);
81259
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
94281
var localDeclaration = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
97757
var localSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToArray();
99086
var localSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToArray();
111770
var localSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>();
111824
var localSyntaxes = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>();
113192
var arrays = tree.GetRoot().
DescendantNodes
().OfType<ArrayTypeSyntax>().ToArray();
113594
var decl = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
113625
var decl = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
113803
var decl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
114028
var decl = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145375
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145382
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145416
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145423
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145456
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145463
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145494
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145501
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145532
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145539
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145572
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145605
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145636
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145643
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145675
var declaration = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
145682
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145952
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
145983
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
146016
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
146298
var @foreach = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
146337
var @foreach = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
146377
var @foreach = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
146416
var @foreach = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
146454
var ifStatement = root.
DescendantNodes
().OfType<IfStatementSyntax>().Single();
146455
var cast = ifStatement.
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
146464
var assignment = newIfStatement.
DescendantNodes
()
154801
var locals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
154869
var locals = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
155997
var identifiers = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "global::Program").ToArray();
156747
var invocationNode = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
156750
var invocationNode2 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
157581
var declarators = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().ToArray();
157629
var method1 = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single());
157631
var invocations = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
158061
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158097
var item = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().First();
158192
var item = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
158230
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158271
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158311
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158345
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158382
var item = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().First();
158477
var item = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
158525
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158567
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158604
var item = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
158815
var declarations = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclarationSyntax>();
160690
var stackallocNode = tree.GetRoot().
DescendantNodes
().OfType<ImplicitStackAllocArrayCreationExpressionSyntax>().Single();
161241
var arms = syntaxTree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionArmSyntax>().ToImmutableArray();
161245
var identifiers = unreachableArm.
DescendantNodes
().OfType<IdentifierNameSyntax>().ToImmutableArray();
161287
var sections = syntaxTree.GetRoot().
DescendantNodes
().OfType<SwitchSectionSyntax>().ToImmutableArray();
161291
var identifiers = unreachableSection.
DescendantNodes
().OfType<IdentifierNameSyntax>().ToImmutableArray();
Semantics\NullCoalesceAssignmentTests.cs (5)
38
var coalesceAssignment = syntaxRoot.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
76
var coalesceAssignment = syntaxRoot.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
119
var coalesceAssignment = syntaxRoot.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
158
var coalesceAssignment = syntaxRoot.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
184
var defaultLiteral = syntaxRoot.
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(expr => expr.IsKind(SyntaxKind.DefaultLiteralExpression)).Single();
Semantics\ObjectAndCollectionInitializerTests.cs (19)
3471
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
3519
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
3576
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
3612
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
3649
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
3691
var objectCreation = root.
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
3741
var objectCreation = root.
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
3785
var objectCreation = root.
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Last();
3814
var literals = syntax.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
3837
var literals = syntax.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
3861
var literals = syntax.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
3935
var nodes = tree.GetRoot().
DescendantNodes
().OfType<InitializerExpressionSyntax>().Skip(1).Single().Expressions;
4017
var nodes = tree.GetRoot().
DescendantNodes
().OfType<GenericNameSyntax>().ToArray();
4058
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
4096
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(n => n.ToString() == "2");
4136
var node1 = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
4168
var nodes = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(n => n.ToString() == "2");
4227
var elementAccess = tree.GetRoot().
DescendantNodes
().OfType<ImplicitElementAccessSyntax>().Single();
4281
var propertyAccess = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First().Left;
Semantics\OperatorTests.cs (20)
47
var orNodes = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().ToArray();
2985
var negOne = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
2991
var boolPlusPlus = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().ElementAt(0);
2997
var errorPlusPlus = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().ElementAt(1);
6939
var syntax = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
7056
var syntax = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
7211
var syntax = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
7330
var methodBody = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last().Body;
7488
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
7704
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
7873
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8033
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8554
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8589
var nodes = tree.GetRoot().
DescendantNodes
().Where(node => node is BinaryExpressionSyntax || node is AssignmentExpressionSyntax).ToArray();
8633
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8683
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8757
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
8812
var methodDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
11337
var negNode = tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
11418
var fieldInitializerOperations = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>()
Semantics\OverloadResolutionPerfTests.cs (2)
982
var expr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<Syntax.InvocationExpressionSyntax>().Last();
1060
var exprs = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToImmutableArray();
Semantics\OverloadResolutionTests.cs (9)
7149
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7259
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7433
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
7474
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
9071
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
9419
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
11763
var expr = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
11812
var expr = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
11862
var expr = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
Semantics\QueryTests.cs (13)
2357
var unknownAccessorDecls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>();
2384
var selectClause = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax;
2385
var fromClause1 = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => (n.IsKind(SyntaxKind.FromClause)) && (n.ToString().Contains("num1"))).Single() as FromClauseSyntax;
2386
var fromClause2 = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => (n.IsKind(SyntaxKind.FromClause)) && (n.ToString().Contains("num2"))).Single() as FromClauseSyntax;
2429
foreach (var ordering in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<OrderingSyntax>())
2484
var selectClause = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax;
2548
var selectClause = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.SelectClause)).Single() as SelectClauseSyntax;
2583
var orderingClause = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.AscendingOrdering)).Single() as OrderingSyntax;
2716
var queryExpr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<QueryExpressionSyntax>().Where(x => x.ToFullString() == "from i in expr1 let ").Single();
2742
var queryExpr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<QueryExpressionSyntax>().Single();
3377
tree.GetCompilationUnitRoot().
DescendantNodes
(n => n.ToString().Contains("assem2"))
3386
tree.GetCompilationUnitRoot().
DescendantNodes
(n => n.ToString().Contains("assem1"))
3607
foreach (var ordering in queryStatement.
DescendantNodes
().OfType<OrderingSyntax>())
Semantics\RawInterpolationTests_Handler.cs (3)
2900
var descendentNodes = tree.GetRoot().
DescendantNodes
();
2903
.Where(b => b.
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().Any())
3126
SyntaxNode syntax = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
Semantics\RecordStructTests.cs (24)
534
var creation = tree.GetRoot().
DescendantNodes
().OfType<AnonymousObjectCreationExpressionSyntax>().Single();
554
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
574
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
596
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
2307
var x = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
2331
var x = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
2594
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2605
var recordDeclaration = tree.GetRoot().
DescendantNodes
().OfType<RecordDeclarationSyntax>().Single();
2629
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2663
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
2698
var x = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First();
3243
var x = doc.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
3285
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
3333
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
3384
var cref = docComments.First().
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().First().Cref;
5849
var parameterSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
5855
var initializerSyntax = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single();
5891
var outVarSyntax = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Single();
6925
var with = tree.GetRoot().
DescendantNodes
().OfType<WithExpressionSyntax>().Single();
7606
var with = tree.GetRoot().
DescendantNodes
().OfType<WithExpressionSyntax>().Single();
8811
var withExpr = tree.GetRoot().
DescendantNodes
().OfType<WithExpressionSyntax>().Single();
10772
tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().First();
10782
tree.GetRoot().
DescendantNodes
().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First();
10787
var baseWithoutParens = tree.GetRoot().
DescendantNodes
().OfType<SimpleBaseTypeSyntax>().Single();
Semantics\RefEscapingTests.cs (9)
69
var decl = root.
DescendantNodes
()
5717
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(3);
5723
var tuple3 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(5);
5729
var tuple6 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(11);
5735
var tuple7 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(13);
5817
var tuple2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(3);
5823
var tuple3 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(5);
5829
var tuple6 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(11);
5835
var tuple7 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().ElementAt(13);
Semantics\RefFieldTests.cs (65)
11025
var decls = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToArray();
11099
var delegateTypesAndLambdas = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => getDelegateTypeAndLambda(model, d)).ToArray();
11128
var value = decl.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
11221
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
11389
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
11981
var expr = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
12061
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
12130
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
12198
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
12380
var decls = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().
12419
var discard = tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>().ToArray();
12567
var decls = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().
12599
var discard = tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>().ToArray();
12793
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
12830
var discard = tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>().ToArray();
12976
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13006
var discard = tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>().ToArray();
13151
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13206
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13265
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13308
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13337
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13362
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13382
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13404
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13439
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13503
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
13579
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13650
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
13714
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
14355
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
14397
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
14522
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
14598
var decls = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
14843
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
14874
var discard = tree.GetRoot().
DescendantNodes
().OfType<DiscardDesignationSyntax>().ToArray();
15051
var decls = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
15077
var decls = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
15132
var decls = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().ToArray();
16550
var invocations = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
16591
var anonymousMethod = tree.GetRoot().
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
16630
var anonymousMethod = tree.GetRoot().
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
16726
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().ToArray();
16775
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Last();
17946
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text == "f").ToArray();
22831
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text is "r1" or "r2").ToArray();
22899
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(v => v.Identifier.Text is "r1" or "r2").ToArray();
23901
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
23937
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
23974
var lambdas = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
24741
var delegateTypesAndLambdas = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Select(d => getDelegateTypeAndLambda(model, d)).ToArray();
24761
var value = decl.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
26788
foreach (var node in tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c"))
26840
foreach (var node in tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c"))
26892
foreach (var node in tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText is "a" or "b" or "c"))
27047
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27137
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27257
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27358
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27403
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27463
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27693
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
27741
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
28831
var fieldInitializerSyntax = tree.GetRoot().
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First();
28874
var constructorSyntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
Semantics\RefLocalsAndReturnsTests.cs (10)
4750
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4778
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4806
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4834
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4862
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4890
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
4924
var assignment = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
5210
var decls = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().ToArray();
5254
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
5293
var decls = tree.GetRoot().
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToArray();
Semantics\ScriptSemanticsTests.cs (5)
244
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExpressionSyntax>().First();
561
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExpressionSyntax>().First();
1313
var x = syntaxTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1342
x = syntaxTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1357
x = syntaxTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
Semantics\SemanticErrorTests.cs (3)
7488
var node = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().First();
13327
var node = tree.GetRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().First();
24224
var node = tree.GetRoot().
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().First();
Semantics\StackAllocInitializerTests.cs (8)
367
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitStackAllocArrayCreationExpressionSyntax>().ToArray();
443
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitStackAllocArrayCreationExpressionSyntax>().ToArray();
1045
var variables = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
1147
var variables = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
2359
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<StackAllocArrayCreationExpressionSyntax>().ToArray();
2465
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitStackAllocArrayCreationExpressionSyntax>().ToArray();
2565
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<StackAllocArrayCreationExpressionSyntax>().ToArray();
2649
var expressions = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ImplicitStackAllocArrayCreationExpressionSyntax>().ToArray();
Semantics\StackAllocSpanExpressionsTests.cs (2)
53
var variables = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
127
var variables = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
Semantics\StructConstructorTests.cs (3)
1050
var syntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
1145
var syntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
1242
var syntax = tree.GetRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().First();
Semantics\SuppressAccessibilityChecksTests.cs (8)
54
var invocation = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
72
var invocation = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
87
var invocation = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
96
statement.
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single());
123
var expr = (ExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single().Body;
169
var invocation = syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
215
AccessorDeclarationSyntax accessorDecl = root.
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
229
.
DescendantNodes
()
Semantics\SwitchTests.cs (1)
1154
var node = syntaxTree.GetRoot().
DescendantNodes
().First(x => x.IsKind(SyntaxKind.SimpleMemberAccessExpression));
Semantics\SyntaxTreeRootTests.cs (1)
108
Assert.Equal(tree, tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single().SyntaxTree);
Semantics\TargetTypedConditionalOperatorTests.cs (2)
668
var expr = tree.GetRoot().
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
689
var expr = tree.GetRoot().
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
Semantics\TargetTypedDefaultTests.cs (35)
42
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
142
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
194
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
242
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
279
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
324
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
518
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
564
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
607
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
665
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
746
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
835
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
864
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1140
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1255
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1629
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1734
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1800
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1871
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
1909
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2089
var def = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ElementAt(0);
2331
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2412
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2455
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
2481
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3055
var def = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
3342
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3381
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3512
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3575
var default1 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
3583
var default2 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DefaultExpressionSyntax>().ElementAt(0);
3590
var default3 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DefaultExpressionSyntax>().ElementAt(1);
3597
var default4 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DefaultExpressionSyntax>().ElementAt(2);
3671
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
3711
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
();
Semantics\TopLevelStatementsTests.cs (87)
194
var localRef = unit1.
DescendantNodes
().OfType<IdentifierNameSyntax>().First();
235
var localDecl = unit1.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
257
foreach (var globalStatement in tree1.GetRoot().
DescendantNodes
().OfType<GlobalStatementSyntax>())
319
var localRef = unit1.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
358
var localDecl = unit2.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
408
foreach (var globalStatement in tree1.GetRoot().
DescendantNodes
().OfType<GlobalStatementSyntax>())
481
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
492
var localFuncRef = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
500
var localRef = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single();
533
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
540
var localRefs = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray();
573
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
584
var localFuncRef = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
591
var localRef = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single();
698
var declarator = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
699
var reference = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "s").Single();
871
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single());
873
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol);
877
var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single());
879
Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol);
985
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First());
987
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").First()).Symbol);
989
var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Skip(1).Single());
991
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Skip(1).Single()).Symbol);
1040
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First());
1042
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol);
1407
var nameRef = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1425
nameRef = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1520
var reference = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "c").Single();
1592
foreach (var id in tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>())
1598
foreach (var id in tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>())
1685
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
1706
var nameRefs = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
1858
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
1882
var nameRefs = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2084
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
2100
var nameRefs = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2248
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
2266
var nameRefs = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2426
var labelDecl = tree1.GetRoot().
DescendantNodes
().OfType<LabeledStatementSyntax>().Single();
2446
var nameRefs = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2919
var nameRef = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single();
2924
nameRef = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2").Single();
2941
nameRef = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single();
2946
nameRef = tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1").Single();
3941
var nameRefs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray();
4090
var nameRefs = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray();
4215
var declarator = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
4216
var reference = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
4510
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single());
4512
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol);
4516
var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().First());
4518
Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol);
4574
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().First());
4576
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").First()).Symbol);
4578
var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Skip(1).First());
4580
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Skip(1).Single()).Symbol);
4623
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().First());
4625
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol);
4893
var declarator = tree.GetRoot().
DescendantNodes
().OfType<LabeledStatementSyntax>().Single();
4894
var reference = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single();
4950
var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().
DescendantNodes
().OfType<LabeledStatementSyntax>().Single());
4952
Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol);
4956
var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().
DescendantNodes
().OfType<LabeledStatementSyntax>().Single());
4959
Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol);
4978
var declarator = tree.GetRoot().
DescendantNodes
().OfType<LabeledStatementSyntax>().Single();
4979
var reference = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single();
6030
var localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
6034
var localRefs = tree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray();
6046
localDecl = tree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
6086
var localFunctions = syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToList();
6160
.GetDeclaredSymbol(syntaxTree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single())
6232
var invocation = syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
6276
var localDecl = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6277
var localRef = syntaxTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
6316
var localDecl = syntaxTree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6317
var localRef = syntaxTree1.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
6366
var localDecl = syntaxTree1.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6368
var localRef = syntaxTree2.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
8578
var invocations = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
8651
var id = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
8673
var id = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single();
8695
var id = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single();
9677
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First(id => id.Identifier.Text == "var");
9681
Assert.Equal(OperationKind.Literal, model.GetOperation(tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single()).Kind);
9707
model.TryGetSpeculativeSemanticModel(root.
DescendantNodes
().Single(n => n is ExpressionStatementSyntax { Parent: GlobalStatementSyntax }).Span.End, nodeToSpeculate, out var speculativeModelInTopLevel);
9712
model.TryGetSpeculativeSemanticModel(root.
DescendantNodes
().Single(n => n is ExpressionStatementSyntax { Parent: BlockSyntax }).Span.End, nodeToSpeculate, out var speculativeModelOutsideTopLevel);
Semantics\TryCatchTests.cs (1)
45
var catchClause = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<CatchClauseSyntax>().Single();
Semantics\TypeOfTests.cs (1)
33
var node = (ObjectCreationExpressionSyntax)tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "new C(0)").Last();
Semantics\UnsafeTests.cs (29)
5197
var methodDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
5383
Assert.True(tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectCreationExpressionSyntax>().
6329
var decl = root.
DescendantNodes
()
6388
var decl = root.
DescendantNodes
()
7257
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
7294
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Single();
7323
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
7361
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
7404
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Single();
7535
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().Last();
7845
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
7912
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
8158
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8225
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8283
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().Single();
8381
foreach (var declarationSyntax in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclarationSyntax>().Where(syntax => syntax.GetFirstToken().IsKind(SyntaxKind.VoidKeyword)))
8861
foreach (var binOpSyntax in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>())
8911
foreach (var binOpSyntax in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>())
9323
foreach (var binOpSyntax in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>())
10177
var declarators = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Reverse().Take(3).Reverse().ToArray();
10223
var declarators = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Reverse().Take(numSymbols).Reverse().ToArray();
10224
var dereferences = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(syntax => syntax.IsKind(SyntaxKind.PointerIndirectionExpression)).ToArray();
10297
var declarators = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Reverse().Take(numSymbols).Reverse().ToArray();
10626
var syntaxes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SizeOfExpressionSyntax>();
10688
var syntaxes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SizeOfExpressionSyntax>();
10748
var syntaxes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SizeOfExpressionSyntax>();
11305
var stackAllocSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<StackAllocArrayCreationExpressionSyntax>().Single();
11837
var parameterSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
11877
var foreachSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
Semantics\UsingStatementTests.cs (8)
60
var usingStatement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().Single();
69
var memberAccessExpression = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
1341
var usingStatement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().Single();
1376
var usingStatement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().Single();
1853
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
1865
var usingStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().ToList();
1881
var usingStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().ToList();
1894
var usingStatements = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().ToList();
Semantics\Utf8StringsLiteralsTests.cs (14)
2970
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
2998
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3026
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3054
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3082
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3110
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3138
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3166
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3194
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3222
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3250
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3278
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
3306
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression;
4081
foreach (var node in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(b => b.IsKind(SyntaxKind.AddExpression)))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (624)
Compilation\GetSemanticInfoBrokenCodeTests.cs (6)
200
Assert.Empty(tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>());
202
foreach (var identifierSyntax in tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>())
224
var usingSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingStatementSyntax>().Single();
245
var typeOfSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
267
var literalSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
300
var identifierSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(n => n.Identifier.ValueText == "CompletionItem");
Compilation\GetSemanticInfoTests.cs (33)
1674
var varIdentifier = (IdentifierNameSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().First(n => n.ToString() == "var");
2356
var lambdaSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single();
2566
var expr = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
3607
var literal = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
3632
var literal = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
3665
var literal = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
3701
var literal = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
4106
var localDecls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclarationSyntax>();
4161
var localDecls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclarationSyntax>();
4292
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<OmittedTypeArgumentSyntax>().Single();
4355
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Last(id => id.Identifier.ValueText == "b");
4400
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Last();
4436
var fieldSyntax = tree.GetRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Single();
4490
var memberAccessSyntax = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
4535
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
4589
var memberAccesses = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToArray();
4641
var memberAccess = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
4687
int position = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First().SpanStart;
4732
int position = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First().SpanStart;
4752
var trueLiteral = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
4785
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
4828
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
4875
var statement = tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>().Single();
5478
var invocationSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
5484
var parameterSyntax = invocationSyntax.
DescendantNodes
().OfType<ParameterSyntax>().First();
5521
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
5535
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
5582
var nullSyntax = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
5620
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
5667
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
5720
var methodGroupSyntax = tree.GetRoot().
DescendantNodes
().OfType<ArgumentSyntax>().Single().Expression;
5988
var foreachSyntaxNode = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
6045
var typeParameters = tree.GetRoot().
DescendantNodes
().OfType<TypeParameterSyntax>().ToArray();
Compilation\GetUnusedImportDirectivesTests.cs (1)
93
var syntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
Compilation\SemanticModelAPITests.cs (104)
43
var m = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single(decl => decl.Identifier.ValueText == "M");
46
var accesses = m.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToList();
51
accesses = m2.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToList();
110
var invoke = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>()
138
var accesses = root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToList();
175
var assignment = root.
DescendantNodes
().OfType<ParenthesizedExpressionSyntax>().Single();
202
var rx = root.
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
209
var rxDecl = root.
DescendantNodes
().OfType<ForStatementSyntax>().Single().Declaration;
234
var rx = root.
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
241
var rxDecl = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
256
var vardecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
276
var vardecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
295
var vardecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<QueryClauseSyntax>().First();
315
var vardecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<QueryClauseSyntax>().First();
334
var statement = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<GotoStatementSyntax>().First();
353
var paramdecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
375
var paramdecl1 = tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
377
var paramdecl2 = tree2.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
404
var nsArray = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(node => node.IsKind(SyntaxKind.NamespaceDeclaration)).ToArray();
425
var nsArray = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(node => node.IsKind(SyntaxKind.FileScopedNamespaceDeclaration)).ToArray();
871
var pType01 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().First();
872
var pType02 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Last();
880
var pMethod01 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
881
var pMethod02 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last();
898
var pParam01 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
899
var pParam02 = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Last();
925
var exprs = root.
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
966
var para1 = tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
967
var para2 = tree2.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().First();
1007
var para1 = tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<TypeParameterSyntax>().First();
1008
var para2 = tree2.GetCompilationUnitRoot().
DescendantNodes
().OfType<TypeParameterSyntax>().First();
1041
var anonProps = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectMemberDeclaratorSyntax>();
1072
var anonProps = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectMemberDeclaratorSyntax>();
1113
var anonProps = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectMemberDeclaratorSyntax>();
1157
var anonProps = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectMemberDeclaratorSyntax>();
1193
var descendants = tree.GetCompilationUnitRoot().
DescendantNodes
();
1232
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
1265
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().Single();
1278
var aliasQualifiedSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AliasQualifiedNameSyntax>().Single();
1306
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().Single();
1311
var aliasQualifiedSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AliasQualifiedNameSyntax>().Single();
1338
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<NameEqualsSyntax>().Single().Name;
1341
var usingSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
1361
var oldSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
1390
var oldSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
1728
var aliasDecl = tree.GetRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
1739
var fieldDecl = tree.GetRoot().
DescendantNodes
().OfType<FieldDeclarationSyntax>().Single();
1962
var lambdaExpression = speculatedStatement.
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().FirstOrDefault();
2026
var oldSyntax = root.
DescendantNodes
()
2046
var thisSyntax = expr.
DescendantNodes
().OfType<ThisExpressionSyntax>().Single();
2072
var oldSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
2092
newSyntax = oldSyntax.ReplaceNode(oldSyntax.
DescendantNodes
().OfType<CastExpressionSyntax>().Single(), newArgument);
2109
newSyntax = oldSyntax.ReplaceNode(oldSyntax.
DescendantNodes
().OfType<CastExpressionSyntax>().Single(), newArgument);
2141
var oldSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConstructorDeclarationSyntax>().Single();
2310
var accessorSyntax = tree.GetRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
2313
var statementSyntax = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().Single();
2683
var lambdaExpression = blockStatement.Statements[0].
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().FirstOrDefault();
2921
var cref = typeDecl.
DescendantNodes
(descendIntoTrivia: true).OfType<TypeCrefSyntax>().Single();
2961
var cref = typeDecl.
DescendantNodes
(descendIntoTrivia: true).OfType<TypeCrefSyntax>().Single();
3006
var cref = typeDecl.
DescendantNodes
(descendIntoTrivia: true).OfType<TypeCrefSyntax>().Single();
3127
var syntax = tree.GetRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().Single().
3230
var omittedArraySize = typeSyntax.
DescendantNodes
().OfType<OmittedArraySizeExpressionSyntax>().Single();
3259
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3271
var method2 = statementSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3300
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3312
var method2 = statementSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3341
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3375
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3388
var method2 = statementSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3417
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3429
var method2 = statementSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3458
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3470
var method2 = statementSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3499
var method1 = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3611
var crefSyntax = root.
DescendantNodes
(descendIntoTrivia: true).OfType<QualifiedCrefSyntax>().Single();
3741
var memberAccess = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
3785
var localFunctionBody = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3786
var typeInfo = model.GetTypeInfo(localFunctionBody.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression!);
3819
var callSyntax = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
3846
var syntax = tree.GetRoot().
DescendantNodes
().OfType<AliasQualifiedNameSyntax>().Single();
3873
var methodDecl = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
3910
var method = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
3911
var init0 = method.Body.Statements[0].
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
3920
var init1 = method.Body.Statements[2].
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
3927
var init2 = method.Body.Statements[4].
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
4107
var actual = tree.GetRoot().
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().ToArray();
4144
var actual = tree.GetRoot().
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().ToArray();
4187
var actual = tree.GetRoot().
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().ToArray();
4211
var actual = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
4239
var actual = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().ToArray();
4277
var actual = tree.GetRoot().
DescendantNodes
().OfType<InterpolatedStringExpressionSyntax>().ToArray();
4427
var ifStatement = root.
DescendantNodes
().OfType<IfStatementSyntax>().Single();
4460
Assert.Equal("DEBUG", model.GetConstantValue(root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single()));
4477
var declarationExpression = root.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
4541
var declarationExpression = root.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
4611
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(ident => ident.Identifier.Text == "global").Single();
4625
var nodes = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(ident => ident.Identifier.Text == "global").ToArray();
4644
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M");
4661
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
4676
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
4692
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "NotNullWhen");
4708
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
4727
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
4743
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (48)
38
var rxDecl = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
60
var rxDecl = root.
DescendantNodes
().OfType<ForStatementSyntax>().Single().Declaration;
3177
var accessorDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AccessorDeclarationSyntax>().Single();
3847
var queryExpr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedExpressionSyntax>().First();
3901
var param = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "name").First();
3922
var usingDirectives = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().ToArray();
3999
var typeofSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
4127
var call = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
4145
call = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
4415
var lambda = (SimpleLambdaExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().First(x => x is SimpleLambdaExpressionSyntax);
4440
var conversionDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConversionOperatorDeclarationSyntax>().Single();
4446
var lookupSymbols = model.LookupSymbols(conversionDecl.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.ImplicitConversionName);
4471
var conversionDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ConversionOperatorDeclarationSyntax>().Single();
4477
var lookupSymbols = model.LookupSymbols(conversionDecl.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.ExplicitConversionName);
4502
var operatorDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<OperatorDeclarationSyntax>().Single();
4508
var lookupSymbols = model.LookupSymbols(operatorDecl.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.AdditionOperatorName);
4604
var node = (DefaultExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Where(i => i is DefaultExpressionSyntax).First();
4691
var decl = (ClassDeclarationSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.ClassDeclaration));
4706
var decl = (ClassDeclarationSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.ClassDeclaration));
4721
var decl = (ClassDeclarationSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.ClassDeclaration));
4741
var enumDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<EnumDeclarationSyntax>().Single();
4742
var eventDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<EventDeclarationSyntax>().Single();
4767
var structDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<StructDeclarationSyntax>().First();
4768
var interfaceDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InterfaceDeclarationSyntax>().Last();
4797
var decl = (TupleExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.TupleExpression));
4820
var decl = (TupleExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.TupleExpression));
4843
var decl = (TupleExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.TupleExpression));
4866
var decl = (TupleExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.TupleExpression));
4889
var decl = (TupleExpressionSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.TupleExpression));
4912
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
4935
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
4958
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
4993
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
5039
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
5088
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
5111
var decl = (ArgumentSyntax)tree.GetCompilationUnitRoot().
DescendantNodes
().Last(n => n.IsKind(SyntaxKind.Argument));
5206
var node = tree.GetRoot().
DescendantNodes
().Single(node => node is IdentifierNameSyntax { Identifier: { ValueText: "b" } });
5222
var decls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().ToArray();
5243
var decls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().ToArray();
5264
var decls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParameterSyntax>().ToArray();
5304
var initializers = root.
DescendantNodes
()
5355
var thingInitializer = root.
DescendantNodes
()
5399
var initializers = root.
DescendantNodes
()
5447
var initializers = root.
DescendantNodes
()
5490
var initializers = root.
DescendantNodes
()
5541
var thingInitializer = root.
DescendantNodes
()
5585
var initializers = root.
DescendantNodes
()
5633
var initializers = root.
DescendantNodes
()
Compilation\SemanticModelGetSemanticInfoTests.cs (8)
14484
var node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<OmittedArraySizeExpressionSyntax>().Last();
14656
var argumentSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AttributeArgumentSyntax>().Single();
14789
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
14885
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
14996
var nodes = (from node in tree.GetRoot().
DescendantNodes
()
15375
foreach (var qc in tree.GetRoot().
DescendantNodes
().OfType<QueryClauseSyntax>())
15380
var qe = tree.GetRoot().
DescendantNodes
().OfType<QueryExpressionSyntax>().Single();
15434
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.ThisExpression);
DocumentationComments\CrefTests.cs (9)
5697
foreach (var id in cref.
DescendantNodes
().OfType<NameSyntax>())
5753
var parameterTypeContainingType = parameterType.
DescendantNodes
().OfType<SimpleNameSyntax>().First();
5797
var typeSyntax = cref.
DescendantNodes
().OfType<SimpleNameSyntax>().First();
6046
var typeParameterSyntax = crefSyntax.
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
6070
var methodNameSyntax = crefSyntax.
DescendantNodes
().OfType<IdentifierNameSyntax>().Last();
6190
var parameterTypeSyntax = crefSyntax.
DescendantNodes
().OfType<CrefParameterSyntax>().Single().Type;
6245
DescendantNodes
().OfType<CrefParameterSyntax>().Single().
6246
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
6619
return docComments.SelectMany(docComment => docComment.
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().Select(attr => attr.Cref));
DocumentationComments\DocumentationCommentIDTests.cs (4)
31
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
144
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<GotoStatementSyntax>().Single().Expression;
165
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
309
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<FromClauseSyntax>().Single();
DocumentationComments\ParameterTests.cs (1)
842
return docComments.SelectMany(docComment => docComment.
DescendantNodes
().OfType<XmlNameAttributeSyntax>().Select(attr => attr.Identifier));
SymbolDisplay\SymbolDisplayTests.cs (28)
5450
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
5890
var methodDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
5900
methodDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
6437
var local = root.
DescendantNodes
()
6480
var local = root.
DescendantNodes
()
6514
var local = root.
DescendantNodes
()
6576
var queryExpression = root.
DescendantNodes
().OfType<QueryExpressionSyntax>().First();
6609
var local = root.
DescendantNodes
()
6670
var declarator = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6703
var declarator = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6748
var declarator = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
6867
var declarations = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray();
6905
var declarations = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray();
6943
var declarations = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Where(n => n.Kind() == SyntaxKind.StructDeclaration).Cast<BaseTypeDeclarationSyntax>().ToArray();
7003
var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.StructDeclaration);
7075
var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.StructDeclaration);
7335
var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.StructDeclaration);
7488
var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.StructDeclaration);
7516
var structure = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.RawKind == (int)VisualBasic.SyntaxKind.StructureStatement);
7737
var variable = tree.GetRoot().
DescendantNodes
().OfType<ForEachVariableStatementSyntax>().Single().Variable;
7832
var constructor = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
7892
var constructor = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
7924
var continuation = tree.GetRoot().
DescendantNodes
().OfType<QueryContinuationSyntax>().Single();
8227
var declaration = (LocalDeclarationStatementSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.LocalDeclarationStatement);
8278
var declaration = (LocalDeclarationStatementSyntax)semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.LocalDeclarationStatement);
8312
var name = tree.GetRoot().
DescendantNodes
().OfType<VisualBasic.Syntax.VariableDeclaratorSyntax>().Single();
8703
var decls = tree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
8759
var binaryExpression = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1005
var nodes = syntaxTree.GetRoot().
DescendantNodes
();
Symbols\AnonymousTypesSymbolTests.cs (1)
1640
var expr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousObjectCreationExpressionSyntax>().Single();
Symbols\CheckedUserDefinedOperatorsTests.cs (10)
7210
var xNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
7211
var yNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
7282
var xNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
7283
var yNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
7353
var xNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
7354
var yNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
7426
var xNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
7427
var yNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
7490
var xNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
7491
var yNode = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").Single();
Symbols\ConversionTests.cs (4)
1728
var castSyntax = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
1735
var forEachSyntax = tree.GetRoot().
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
1798
var syntax = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
1832
var syntax = tree.GetRoot().
DescendantNodes
().OfType<CastExpressionSyntax>().Single();
Symbols\CorLibrary\CorTypes.cs (2)
294
var node = tree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
359
var node = tree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
Symbols\CovariantReturnTests.cs (2)
379
foreach (var declaration in tree.GetRoot().
DescendantNodes
().OfType<LocalDeclarationStatementSyntax>())
2622
foreach (var localDeclaration in vbTree.GetRoot().
DescendantNodes
().OfType<VisualBasic.Syntax.LocalDeclarationStatementSyntax>())
Symbols\DestructorTests.cs (2)
407
var destructorDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<DestructorDeclarationSyntax>().Single();
413
var finalizeSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single().Name;
Symbols\EnumTests.cs (1)
353
var expr = tree.GetRoot().
DescendantNodes
().Single(n => n.Kind() == SyntaxKind.BitwiseNotExpression);
Symbols\ExtensionMethodTests.cs (9)
227
syntaxTree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single()).Symbol;
2952
var memberAccess = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
3010
var memberAccess = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
3139
var nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList();
3778
var member = (MemberAccessExpressionSyntax)syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3866
var instance = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
3913
var instance = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
3958
var instance = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
4008
var instance = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
Symbols\FunctionPointerTypeSymbolTests.cs (25)
52
.
DescendantNodes
()
124
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
204
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
285
syntaxTree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().Single(),
339
var functionPointers = syntaxTree.GetRoot().
DescendantNodes
().OfType<FunctionPointerTypeSyntax>().ToArray();
405
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
485
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
602
var parameterDecls = syntaxTree.GetRoot().
DescendantNodes
()
685
.
DescendantNodes
()
1149
.
DescendantNodes
()
1260
.
DescendantNodes
()
1317
.
DescendantNodes
()
1428
.
DescendantNodes
()
1685
var mDeclSyntax = syntaxTree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Skip(2).Single();
1697
var varDecl = mDeclSyntax.
DescendantNodes
().OfType<VariableDeclarationSyntax>().Single();
1711
var assignment = mDeclSyntax.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
1730
InvocationExpressionSyntax invocationExpressionSyntax = mDeclSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1746
var returnExpression = mDeclSyntax.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression!;
1796
var methodDecls = syntaxTree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ToArray();
1799
.SelectMany(m => m.
DescendantNodes
().OfType<FunctionPointerTypeSyntax>())
1820
var decls = m2DeclSyntax.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
1841
var invocations = m2DeclSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1867
var variableDeclaratorSyntax = m3DeclSyntax.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
1877
var invocationExpr = m3DeclSyntax.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
1926
var decls = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToArray();
Symbols\GenericConstraintTests.cs (2)
7393
var nest = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Nest").Single();
7418
var nest = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Nest").Single();
Symbols\ImplicitClassTests.cs (3)
73
IEnumerable<IdentifierNameSyntax> identifiers = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>();
116
var namespaceDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<NamespaceDeclarationSyntax>().Single();
117
var methodDecl = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
Symbols\IndexerTests.cs (1)
2844
ExpressionSyntax expr = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().FirstOrDefault();
Symbols\LocalFunctionTests.cs (4)
35
var localSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
56
var localSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
77
var localSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
100
var localsSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ToArray();
Symbols\Metadata\MetadataTypeTests.cs (2)
372
var id = newTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First();
387
id = newTree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First();
Symbols\RelaxedShiftOperatorTests.cs (6)
102
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
146
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
190
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
234
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
278
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
322
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single();
Symbols\RequiredMembersTests.cs (1)
6951
var tuple = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().First();
Symbols\Source\BaseClassTests.cs (1)
2031
var baseY = tree.GetRoot().
DescendantNodes
().Where(n => n.ToString() == "y").OfType<ExpressionSyntax>().First();
Symbols\Source\DelegateTests.cs (4)
738
var anonymousMethod = root.
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
765
var anonymousMethod = root.
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
827
ExpressionSyntax lambdaSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ParenthesizedLambdaExpressionSyntax>().Single();
834
lambdaSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<AnonymousMethodExpressionSyntax>().Single();
Symbols\Source\EnumTests.cs (1)
979
var decls = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<EnumDeclarationSyntax>().ToArray();
Symbols\Source\EventTests.cs (4)
435
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().First();
441
var parameterSyntax = lambdaSyntax.
DescendantNodes
().OfType<ParameterSyntax>().First();
481
var lambdaSyntax = tree.GetRoot().
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().First();
487
var parameterSyntax = lambdaSyntax.
DescendantNodes
().OfType<ParameterSyntax>().First();
Symbols\Source\ExternAliasTests.cs (4)
408
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().Single();
434
var aliasSyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().Single();
479
var externAliasSyntax = root.
DescendantNodes
().OfType<ExternAliasDirectiveSyntax>().Single();
480
var usingSyntax = root.
DescendantNodes
().OfType<UsingDirectiveSyntax>().Single();
Symbols\Source\FileModifierTests.cs (20)
1233
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last().Expression;
1367
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last().Expression;
1433
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last().Expression;
1491
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last().Expression;
1805
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last();
1880
var cReference = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Last();
2600
var node = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
2639
var node = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
3510
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
3559
var invocation = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
3612
var invoked = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression;
3641
var body = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last().Body!;
3711
var body = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last().Body!;
3773
var body = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last().Body!;
3814
var body = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Last().Body!;
3977
var methodNameSyntax = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Single();
4124
var voidTypeSyntax = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single().Type!;
4410
var node = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
4454
var node = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
4477
var node = tree.GetRoot().
DescendantNodes
().OfType<ParameterSyntax>().Single();
Symbols\Source\LocalTests.cs (1)
59
var expressionSyntax = tree.GetRoot().
DescendantNodes
().
Symbols\Source\MethodTests.cs (7)
236
var node = tree.GetRoot().
DescendantNodes
().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).First();
264
var node = tree.GetRoot().
DescendantNodes
().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Last();
289
var node = tree.
DescendantNodes
().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Single();
310
var node = tree.
DescendantNodes
().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).Single();
2540
var methods = syntax.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ToArray();
2571
var type = syntax.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
2572
var methods = syntax.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().ToArray();
Symbols\Source\NullablePublicAPITests.cs (180)
55
var arrayAccesses = root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToList();
89
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList();
570
return syntaxTree.GetRoot().
DescendantNodes
().OfType<CSharp.Syntax.LocalFunctionStatementSyntax>().Select(func => semanticModel.GetDeclaredSymbol(func)).Cast<IMethodSymbol>().ToArray();
945
var invocations = syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>();
1002
var variables = syntaxTree.GetRoot().
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
1096
var invocation = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Last();
1123
_ = model.GetTypeInfoAndVerifyIOperation(root.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single().Value);
1219
var dCast = (CastExpressionSyntax)root.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().Single().Value;
1263
var conditional = root.
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
1361
var ifStatement = root.
DescendantNodes
().OfType<IfStatementSyntax>().Single();
1362
var conditionalAccessExpression = root.
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().Single();
1363
var ternary = root.
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
1441
var returnStatement = root.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single();
1443
var yReference = ((MemberAccessExpressionSyntax)newSource.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single().Expression).Expression;
1513
var ifStatement = root.
DescendantNodes
().OfType<IfStatementSyntax>().Single();
1514
var conditionalAccessExpression = root.
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().Single();
1515
var ternary = root.
DescendantNodes
().OfType<ConditionalExpressionSyntax>().ElementAt(1);
1569
var ifStatement = root.
DescendantNodes
().OfType<IfStatementSyntax>().Single();
1570
var conditionalAccessExpression = root.
DescendantNodes
().OfType<ConditionalAccessExpressionSyntax>().Single();
1571
var ternary = root.
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
1626
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
1627
var varDecl = lambda.
DescendantNodes
().OfType<VariableDeclarationSyntax>().Single();
1669
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
1670
var varDecl = lambda.
DescendantNodes
().OfType<VariableDeclarationSyntax>().Single();
1712
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
1713
var varDecl = lambda.
DescendantNodes
().OfType<VariableDeclarationSyntax>().Single();
1851
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1894
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToArray();
1939
var declarations = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToList();
1986
var declarations = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToList();
2047
var declarations = root.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().ToList();
2056
var symbols = variable.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList();
2090
var declarations = root.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().ToList();
2099
var symbols = variable.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList();
2133
var s2Assignment = root.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
2134
var lastDeclaration = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(3);
2136
var newDeclarator = newDeclaration.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
2176
var declarations = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToList();
2218
var declaration = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
2248
var declarations = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToList();
2283
var declarations = root.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToList();
2327
var declarations = root.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToList();
2368
var declarations = root.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToList();
2413
var declarations = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ToList();
2453
var declarations = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().ToList();
2501
var declarations = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().ToList();
2546
var declarations = root.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>().ToList();
2595
var declarations = root.
DescendantNodes
().OfType<ForEachStatementSyntax>().ToList();
2629
var sRef = root.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "s").Single();
2663
var select = root.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Select").Single();
2701
var select = root.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == "Select").Single();
2737
var memberAccess = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToList();
2783
var memberAccess = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToList();
2826
var memberAccess = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToList();
2875
var memberAccess = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToList();
2916
var memberAccess = root.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToList();
2927
var lhs = root.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single().Left;
2957
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().Single();
2999
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().Single();
3041
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().Single();
3101
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().Single();
3148
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().First();
3193
var collectionInitializer = root.
DescendantNodes
().OfType<InitializerExpressionSyntax>().First();
3258
var indexers = root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan();
3310
var elementAccesses = root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan();
3359
var elementAccesses = root.
DescendantNodes
().OfType<ElementAccessExpressionSyntax>().ToArray();
3405
var operators = root.
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().ToList();
3450
var operators = root.
DescendantNodes
().OfType<BinaryExpressionSyntax>().ToList();
3488
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3495
var o1Ref = lambda.
DescendantNodes
()
3498
.
DescendantNodes
()
3507
var mDeclaration = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().First(m => m.Identifier.ValueText == "M");
3537
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
3540
var innerLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
3549
var o1Ref = innerLambda.
DescendantNodes
()
3552
.
DescendantNodes
()
3560
var o2Ref = innerLambda.
DescendantNodes
()
3563
.
DescendantNodes
()
3598
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
3601
var innerLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
3610
var o1Ref = innerLambda.
DescendantNodes
()
3613
.
DescendantNodes
()
3621
var o2Ref = innerLambda.
DescendantNodes
()
3624
.
DescendantNodes
()
3661
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3664
var localFunction = lambda.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
3667
var o2Reference = localFunction.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o2");
3697
var localFunctionBody = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
3698
var typeInfo = model.GetTypeInfo(localFunctionBody.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression!);
3732
var localFunctionBody = tree.GetRoot().
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3733
var typeInfo = model.GetTypeInfo(localFunctionBody.
DescendantNodes
().OfType<ReturnStatementSyntax>().Single().Expression!);
3769
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3770
var o1Ref = lambda.
DescendantNodes
()
3773
.
DescendantNodes
()
3808
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().Single();
3810
var parameter = lambda.
DescendantNodes
().OfType<ParameterSyntax>().Single();
3854
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
3856
var o2Declaration = lambda.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First();
3862
var innerLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
3863
var innerO2Reference = innerLambda.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o2");
3868
var @foreach = lambda.
DescendantNodes
().OfType<ForEachStatementSyntax>().Single();
3871
foreach (var singleVarDesignation in lambda.
DescendantNodes
().OfType<SingleVariableDesignationSyntax>())
3876
var localFunction = lambda.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
3879
var o8Declaration = localFunction.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
3913
var fieldLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
3915
var o1Reference = fieldLambda.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o1");
3917
var o2Decl = fieldLambda.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
3927
var propertyLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
3929
var o3Reference = propertyLambda.
DescendantNodes
().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o3");
3931
var o4Decl = propertyLambda.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
3978
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
3981
var innerLambda1 = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
3991
var innerLambda2 = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
4047
var lambda = root.
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().First();
4050
var o2Decl = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().ElementAt(1);
4053
var o1Ref = root.
DescendantNodes
().OfType<AttributeArgumentSyntax>().Last().Expression;
4056
var o2Ref = root.
DescendantNodes
().OfType<ParameterSyntax>().Last().Default.Value;
4062
var localFunction = root.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
4065
var speculativeO2Ref = speculativeAttribute.
DescendantNodes
().OfType<AttributeArgumentSyntax>().Single().Expression;
4114
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
4116
var innerLambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().ElementAt(1);
4117
var localFunction = lambda.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
4120
var position = localFunction.
DescendantNodes
().OfType<VariableDeclarationSyntax>().Single().Span.End;
4177
var lambda = root.
DescendantNodes
().OfType<LambdaExpressionSyntax>().First();
4179
var localFunction = lambda.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().First();
4181
var nestedLocalFunction = (IMethodSymbol)model.GetDeclaredSymbol(lambda.
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().ElementAt(1));
4211
var attributeUsage = root.
DescendantNodes
().OfType<AttributeSyntax>().ElementAt(1);
4242
var typeOf = syntaxTree.GetRoot().
DescendantNodes
().OfType<TypeOfExpressionSyntax>().Single();
4272
var default0 = root.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().ElementAt(0).Value;
4275
var default1 = root.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().ElementAt(1).Value;
4306
var default0 = root.
DescendantNodes
().OfType<AttributeArgumentSyntax>().ElementAt(0).Expression;
4309
var default1 = root.
DescendantNodes
().OfType<AttributeArgumentSyntax>().ElementAt(1).Expression;
4335
var exprs = tree.GetRoot().
DescendantNodes
().OfType<DefaultExpressionSyntax>().ToArray();
4365
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4370
var type2 = statement.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4393
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4398
var type2 = statement.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4421
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4428
var type2 = statement.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4451
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4458
var type2 = statement.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4481
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4488
var type2 = statement.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4511
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4520
var type2 = methodDeclaration.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4543
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4553
var type2 = methodDeclaration.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4576
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4581
var type2 = arrow.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4604
var type = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4611
var type2 = arrow.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4637
var initializer = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
4642
var type2 = newInitializer.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4668
var initializer = tree.GetRoot().
DescendantNodes
().OfType<ConstructorInitializerSyntax>().Single();
4675
var type2 = newInitializer.
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single().Type;
4699
var initializer = tree.GetRoot().
DescendantNodes
().OfType<DeclarationExpressionSyntax>().Single();
4730
var suppressions = tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().Where(p => p.IsKind(SyntaxKind.SuppressNullableWarningExpression)).ToList();
4780
var invocations = syntaxTree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>();
4816
var memberAccesses = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().ToArray();
4903
.
DescendantNodes
()
4914
var newAccess = newBody.
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single();
4933
var localFunction = tree.GetRoot().
DescendantNodes
().OfType<LocalFunctionStatementSyntax>().Single();
4966
var ternary = tree.GetRoot().
DescendantNodes
().OfType<ConditionalExpressionSyntax>().Single();
5010
var tupleLiteral = tree.GetRoot().
DescendantNodes
().OfType<TupleExpressionSyntax>().Single();
5049
var constructor = tree.GetRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
5052
var assignmentsInLambda = constructor.
DescendantNodes
().OfType<AssignmentExpressionSyntax>().ToArray();
5065
var switchExpressionInput = tree.GetRoot().
DescendantNodes
().OfType<SwitchExpressionSyntax>().Single().GoverningExpression;
5102
var binaryRight = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single().Right;
5134
var binaryRight = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single().Right;
5162
var binaryRightArgument = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Single().Right.
DescendantNodes
().OfType<ArgumentSyntax>().Single().Expression;
5197
var xUsage = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single().Expression;
5232
var xUsage = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().Single().Expression;
5255
var collectionExpr = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
5278
var collectionExpr = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
5310
var collectionExpr = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
5333
var collectionExpr = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
5355
var collectionExpr = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().Single();
5400
var collectionExprs = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
5457
var collectionExprs = root.
DescendantNodes
().OfType<CollectionExpressionSyntax>().ToArray();
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (2)
36
var varDeclarators = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>();
41
Symbol m2 = model.GetDeclaredSymbol(root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().ElementAt(1)).GetSymbol();
Symbols\Source\UsingAliasTests.cs (2)
697
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Short").Skip(1).Single();
740
var node = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Short").Skip(1).Single();
Symbols\StaticAbstractMembersInInterfacesTests.cs (28)
8453
var node = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First();
9041
var node = postfixOp != "" ? (ExpressionSyntax)tree.GetRoot().
DescendantNodes
().OfType<PostfixUnaryExpressionSyntax>().First() : tree.GetRoot().
DescendantNodes
().OfType<PrefixUnaryExpressionSyntax>().First();
9356
var node = tree.GetRoot().
DescendantNodes
().OfType<ConditionalExpressionSyntax>().First();
9755
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
10752
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single();
10945
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single();
11135
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " y").Single();
11329
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First();
11583
var node1 = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First();
11960
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(n => n.ToString() == "x " + op + "= 1").Single();
12139
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
13180
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First().Right;
13266
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First().Left;
13388
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First().Left;
14089
var node = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().First().Left;
14098
node = tree.GetRoot().
DescendantNodes
().OfType<InvocationExpressionSyntax>().First().ArgumentList.Arguments[0].Expression;
14714
var node = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
15120
var node = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
15388
var node = tree.GetRoot().
DescendantNodes
().OfType<MemberAccessExpressionSyntax>().First();
19560
var node = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19643
var node = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19735
var node = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19824
var node = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
28773
var node = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
30280
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().First();
30471
var node = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().First();
30937
var node = tree.GetRoot().
DescendantNodes
().OfType<ReturnStatementSyntax>().First();
Symbols\SymbolEqualityTests.cs (33)
41
var invocations = root.
DescendantNodes
().OfType<BinaryExpressionSyntax>().ToList();
84
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList();
124
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList();
165
var invocations = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().ToList();
411
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
412
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
449
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
450
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
480
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
481
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
523
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
524
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
554
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
555
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
590
var create1Syntax = (InvocationExpressionSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.InvocationExpression);
591
var create2Syntax = (InvocationExpressionSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.InvocationExpression);
625
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
626
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
674
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.ClassDeclaration).
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
675
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.ClassDeclaration).
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
726
var member1Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
727
var member2Syntax = (FieldDeclarationSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.FieldDeclaration);
776
var member1Syntax = (ClassDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.ClassDeclaration);
777
var member2Syntax = (IdentifierNameSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.IdentifierName);
827
var member1Syntax = (ClassDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.ClassDeclaration);
828
var member2Syntax = (IdentifierNameSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.SimpleMemberAccessExpression).
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.IdentifierName);
888
var member1Syntax = (ClassDeclarationSyntax)root.
DescendantNodes
().First(sn => sn.Kind() == SyntaxKind.ClassDeclaration);
889
var member2Syntax = (IdentifierNameSyntax)root.
DescendantNodes
().Last(sn => sn.Kind() == SyntaxKind.IdentifierName);
935
var lambdaSyntax = root.
DescendantNodes
().OfType<SimpleLambdaExpressionSyntax>().First();
961
var syntaxNode = syntaxTree.GetRoot().
DescendantNodes
().
Symbols\SymbolExtensionTests.cs (5)
101
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First(id => id.Identifier.Text == "var");
119
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First(id => id.Identifier.Text == "var");
137
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().First(id => id.Identifier.Text == "var");
156
var identifier = tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Last(id => id.Identifier.Text == "var");
252
var method = model.GetSymbolInfo(tree.GetRoot().
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Method").Single()).Symbol.GetSymbol<MethodSymbol>();
Symbols\TypeTests.cs (1)
1854
var syntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<ObjectCreationExpressionSyntax>().Single();
Symbols\UnsignedRightShiftTests.cs (13)
123
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First();
124
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First();
626
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
627
var shift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First();
1176
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First();
1177
var shift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First();
1584
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
1585
var shift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First();
1983
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First();
2235
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First();
2377
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
2511
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First();
2608
var unsignedShift = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (84)
Diagnostics\DiagnosticTest.cs (1)
1981
var nodes = ParseWithRoundTripCheck(text).GetRoot().
DescendantNodes
(descendIntoTrivia: true);
LexicalAndXml\PreprocessorTests.cs (1)
4566
var nodes = root.
DescendantNodes
(descendIntoTrivia: true);
Parsing\CrefParsingTests.cs (1)
31
var attr = structure.
DescendantNodes
().OfType<XmlCrefAttributeSyntax>().Single();
Parsing\LocalFunctionParsingTests.cs (2)
1228
var m = Assert.IsType<MethodDeclarationSyntax>(file.
DescendantNodes
()
1289
Assert.True(file.
DescendantNodes
().Any(n => n.Kind() == SyntaxKind.LocalFunctionStatement && !n.ContainsDiagnostics));
Parsing\NameAttributeValueParsingTests.cs (1)
32
var attr = structure.
DescendantNodes
().OfType<XmlNameAttributeSyntax>().Single();
Parsing\ParserErrorMessageTests.cs (7)
3767
var methodDeclaration = (MethodDeclarationSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is MethodDeclarationSyntax);
3770
var delegateDeclaration = (DelegateDeclarationSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is DelegateDeclarationSyntax);
3773
var localFunctionStatement = (LocalFunctionStatementSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is LocalFunctionStatementSyntax);
3776
var lambdaExpression = (ParenthesizedLambdaExpressionSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is ParenthesizedLambdaExpressionSyntax);
3779
var anonymousMethodExpression = (AnonymousMethodExpressionSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is AnonymousMethodExpressionSyntax);
3782
var indexerDeclaration = (IndexerDeclarationSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is IndexerDeclarationSyntax);
3785
var operatorDeclaration = (OperatorDeclarationSyntax)tree.GetRoot().
DescendantNodes
().Single(node => node is OperatorDeclarationSyntax);
Parsing\ParsingErrorRecoveryTests.cs (10)
7937
var classDecl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
7941
var ns = root.
DescendantNodes
().OfType<NamespaceDeclarationSyntax>().Single();
7958
var classDecl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
7962
var ns = root.
DescendantNodes
().OfType<FileScopedNamespaceDeclarationSyntax>().Single();
7979
var structDecl = root.
DescendantNodes
().OfType<StructDeclarationSyntax>().Single();
7982
var ns = root.
DescendantNodes
().OfType<NamespaceDeclarationSyntax>().Single();
8002
var structDecl = root.
DescendantNodes
().OfType<StructDeclarationSyntax>().Single();
8006
var ns = root.
DescendantNodes
().OfType<NamespaceDeclarationSyntax>().Single();
8026
var classDecl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
8030
var ns = root.
DescendantNodes
().OfType<NamespaceDeclarationSyntax>().Single();
Parsing\StatementParsingTests.cs (1)
3467
var filterClause = root.
DescendantNodes
().OfType<CatchFilterClauseSyntax>().Single();
Parsing\VerbatimCrefParsingTests.cs (1)
31
var attr = structure.
DescendantNodes
().OfType<XmlTextAttributeSyntax>().Single();
Syntax\FieldAndValueKeywordTests.cs (1)
1277
var expr = syntaxTree.GetRoot().
DescendantNodes
().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
Syntax\LambdaUtilitiesTests.cs (1)
57
var methodDef = tree.GetRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Where(d => d.Identifier.ValueText == "M").Single();
Syntax\SyntaxListTests.cs (3)
332
var node = tree.GetRoot().
DescendantNodes
().OfType<InitializerExpressionSyntax>().First();
356
var node = tree.GetRoot().
DescendantNodes
().OfType<InitializerExpressionSyntax>().First();
402
return tree.GetRoot().
DescendantNodes
().OfType<InitializerExpressionSyntax>().First();
Syntax\SyntaxNodeTests.cs (33)
85
var e = expression.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "e");
103
var e = expression.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "e");
122
var e = expression.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "e");
135
var nodes = statement.
DescendantNodes
().ToList();
139
nodes = statement.
DescendantNodes
(descendIntoTrivia: true).ToList();
145
nodes = statement.
DescendantNodes
(n => n is StatementSyntax).ToList();
149
nodes = statement.
DescendantNodes
(n => n is StatementSyntax, descendIntoTrivia: true).ToList();
493
var identifierNodes = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().ToList();
712
var identifier = root.
DescendantNodes
(descendIntoTrivia: true).Single(n => n is IdentifierNameSyntax);
888
tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single().IsIncrementallyIdenticalTo(
889
tree2.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single()));
899
tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single().IsIncrementallyIdenticalTo(
900
tree2.GetCompilationUnitRoot().
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single()));
2092
expr.
DescendantNodes
().OfType<ExpressionSyntax>(),
2702
var m = cu.
DescendantNodes
().OfType<MethodDeclarationSyntax>().FirstOrDefault();
2736
var m = cu.
DescendantNodes
().OfType<MethodDeclarationSyntax>().FirstOrDefault();
2771
var m = cu.
DescendantNodes
().OfType<MethodDeclarationSyntax>().FirstOrDefault();
2811
var m = cu.
DescendantNodes
().OfType<MethodDeclarationSyntax>().FirstOrDefault();
2843
var m = cu.
DescendantNodes
().OfType<MethodDeclarationSyntax>().FirstOrDefault();
2860
var m = cu.
DescendantNodes
().OfType<TypeDeclarationSyntax>().LastOrDefault();
2876
var m = cu.
DescendantNodes
().OfType<TypeDeclarationSyntax>().LastOrDefault();
2935
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().FirstOrDefault();
2976
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().FirstOrDefault();
3020
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().FirstOrDefault();
3062
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().FirstOrDefault();
3104
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().LastOrDefault();
3144
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().LastOrDefault();
3187
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().LastOrDefault();
3228
var m = cu.
DescendantNodes
().OfType<ParameterSyntax>().LastOrDefault();
3252
var m = cu.
DescendantNodes
().OfType<TypeDeclarationSyntax>().FirstOrDefault();
3529
var method = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().Single();
3819
var a = expression.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
3820
var e = expression.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "e");
Syntax\SyntaxRewriterTests.cs (7)
349
var typeName = tree.GetCompilationUnitRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.GenericName)).Single();
363
var before = root.
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
382
var invocation = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
401
var invocation = root.
DescendantNodes
().OfType<InvocationExpressionSyntax>().Single();
516
var newRoot = root.RemoveNode(root.
DescendantNodes
().First(), SyntaxRemoveOptions.KeepDirectives);
601
var ifStmt1 = tree1.GetCompilationUnitRoot().
DescendantNodes
().OfType<IfStatementSyntax>().Single();
651
var xmlNode = oldRoot.
DescendantNodes
(descendIntoTrivia: true).OfType<XmlEmptyElementSyntax>().Single();
Syntax\TrackNodeTests.cs (14)
24
var a = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
35
var a = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
47
var a = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
56
var a = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
66
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
81
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
97
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
109
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
122
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
126
var replacedExpr = trackedExpr.ReplaceNodes(trackedExpr.
DescendantNodes
().OfType<IdentifierNameSyntax>(), (original, changed) => currentA);
134
var originalA = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().First(n => n.Identifier.Text == "a");
138
var replacedExpr = trackedExpr.ReplaceNodes(trackedExpr.
DescendantNodes
().OfType<IdentifierNameSyntax>(), (original, changed) => currentA);
149
var ids = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().ToList();
167
var ids = expr.
DescendantNodes
().OfType<IdentifierNameSyntax>().ToList();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
774
return tree.GetRoot().
DescendantNodes
().OfType<T>().Where(e => e.ToString() == text);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
CodeGen\WinMdEventTests.cs (1)
671
var syntax = tree.GetRoot().
DescendantNodes
().OfType<AssignmentExpressionSyntax>().Single();
CodeGen\WinRTCollectionTests.cs (1)
7424
var add = tree.GetRoot().
DescendantNodes
().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Add").Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Simplification\Simplifiers\NameSimplifier.cs (1)
643
simplifiedNode.
DescendantNodes
().Any(n => n is PointerTypeSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
449
=> node.
DescendantNodes
(n => n == node || !n.IsReturnableConstruct()).Any(n => n is YieldStatementSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
389
foreach (var localFunction in node.
DescendantNodes
().Where(CSharpSyntaxFacts.Instance.IsLocalFunctionStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
255
var originalIdentifierNodes = originalLambdaBody.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
261
var replacedIdentifierNodes = replacedLambdaBody.
DescendantNodes
().OfType<IdentifierNameSyntax>().Where(node => paramNames.Contains(node.Identifier.ValueText));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
45
foreach (var child in memberDeclaration.
DescendantNodes
())
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (8)
CodeGeneration\SyntaxGeneratorTests.cs (5)
2662
var summary = cls.
DescendantNodes
(descendIntoTrivia: true).OfType<XmlElementSyntax>().First();
2686
var summary = cls.
DescendantNodes
(descendIntoTrivia: true).OfType<XmlElementSyntax>().First();
2711
var text = cls.
DescendantNodes
(descendIntoTrivia: true).OfType<XmlTextSyntax>().First();
2734
var text = cls.
DescendantNodes
(descendIntoTrivia: true).OfType<XmlTextSyntax>().First();
4581
var decl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().First();
Formatting\FormattingElasticTriviaTests.cs (1)
111
var decl = generator.GetDeclaration(root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().First(vd => vd.Identifier.Text == "f2"));
Formatting\FormattingTreeEditTests.cs (2)
43
var param = root.
DescendantNodes
().OfType<ParameterSyntax>().First();
56
var method = root.
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Semantics\SpeculationAnalyzerTestsBase.cs (2)
36
var initialNode = initialTree.GetRoot().
DescendantNodes
().First(n => IsExpressionNode(n) && n.ToString() == (expressionToAnalyze ?? initialExpression));
39
var replacementNode = replacementTree.GetRoot().
DescendantNodes
().First(n => IsExpressionNode(n) && n.ToString() == (expressionToAnalyze ?? replacementExpression));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeFixes\CodeFixServiceTests.cs (1)
1202
var variableDeclarations = context.SemanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType<CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax>();
CodeGeneration\AbstractCodeGenerationTests.cs (2)
94
var expression = simplifiedRootNode.
DescendantNodes
().OfType<EqualsValueClauseSyntax>().First().Value;
115
var expression = simplifiedRootNode.
DescendantNodes
().OfType<EqualsValueSyntax>().First().Value;
SymbolFinder\DependentTypeFinderTests.cs (1)
647
var firstDecl = csRoot.
DescendantNodes
().First(d => d is CSharp.Syntax.TypeDeclarationSyntax);
Utilities\SymbolEquivalenceComparerTests.cs (2)
1891
var invocation = method_root.
DescendantNodes
().OfType<TInvocation>().FirstOrDefault();
1893
invocation ??= method_root.Parent.
DescendantNodes
().OfType<TInvocation>().First();
Microsoft.CodeAnalysis.Features (18)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
96
var nodes = root.
DescendantNodes
();
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
184
=> root.
DescendantNodes
(n => n is TCompilationUnitSyntax or TNamespaceDeclarationSyntax)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
217
.
DescendantNodes
(spine.Contains)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
833
? container.
DescendantNodes
().First()
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
155
var identifiers = containingMember.
DescendantNodes
().OfType<TIdentifierNameSyntax>();
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
194
var ifStatements = editor.OriginalRoot.
DescendantNodes
().OfType<TIfStatementSyntax>().ToArray();
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
69
var typeNames = member.
DescendantNodes
().Where(n => IsQualifiedOrSimpleName(n) && !n.Span.IsEmpty);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
195
foreach (var coalesceNode in syntax.
DescendantNodes
().OfType<TBinaryExpressionSyntax>())
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
190
foreach (var child in condition.Syntax.
DescendantNodes
().OfType<TExpressionSyntax>())
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
200
var variablesInExpression = expression.
DescendantNodes
();
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
65
var variablesInExpression = _expression.
DescendantNodes
().OfType<TIdentifierNameSyntax>();
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
162
=> node.AncestorsAndSelf().OfType<TNamespaceDeclarationSyntax>().Count() + node.
DescendantNodes
().OfType<TNamespaceDeclarationSyntax>().Count();
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
105
.
DescendantNodes
(n => n is TNamespaceSyntax)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
151
if (operationBlock.Syntax.
DescendantNodes
(descendIntoTrivia: true)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
135
nodes = docComment.
DescendantNodes
(descendIntoChildren: _ => true)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
192
var returns = node.
DescendantNodes
(n => n == node || !IsAsyncSupportingFunctionSyntax(n)).OfType<TReturnStatementSyntax>();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
634
foreach (var localDeclarationStatement in containingMemberDeclaration.
DescendantNodes
().OfType<TLocalDeclarationStatementSyntax>())
833
memberDeclaration.
DescendantNodes
()
Microsoft.CodeAnalysis.Features.UnitTests (3)
FindUsages\DefinitionItemFactoryTests.cs (3)
1452
var f = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().Single(n => n is LocalFunctionStatementSyntax));
1518
var x = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().Single(n => n is VariableDeclaratorSyntax));
1589
var r = model.GetDeclaredSymbol(tree.GetRoot().
DescendantNodes
().Single(n => n is FromClauseSyntax));
Microsoft.CodeAnalysis.Test.Utilities (3)
CommonTestBase.cs (1)
648
foreach (var node in model.SyntaxTree.GetRoot().
DescendantNodes
())
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
2600
var fields = context.Tree.GetRoot().
DescendantNodes
().OfType<CSharp.Syntax.FieldDeclarationSyntax>();
2850
foreach (var localDecl in root.
DescendantNodes
().OfType<CSharp.Syntax.LocalDeclarationStatementSyntax>())
Microsoft.CodeAnalysis.UnitTests (7)
CommonSyntaxTests.cs (4)
210
var exprB = expr.
DescendantNodes
().OfType<CSharp.Syntax.IdentifierNameSyntax>().First(n => n.Identifier.ToString() == "b");
216
nodes: trackedExpr.
DescendantNodes
().OfType<CSharp.Syntax.ExpressionSyntax>(),
231
var exprB = expr.
DescendantNodes
().OfType<CSharp.Syntax.IdentifierNameSyntax>().First(n => n.Identifier.ToString() == "b");
239
nodes: trackedExpr.
DescendantNodes
().OfType<CSharp.Syntax.ExpressionSyntax>(),
Diagnostics\OperationTests.cs (3)
277
var methodBodySyntax = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType<BaseMethodDeclarationSyntax>().Last();
310
var literal = tree.GetRoot().
DescendantNodes
().OfType<LiteralExpressionSyntax>().Single();
323
var classDecl = tree.GetRoot().
DescendantNodes
().OfType<ClassDeclarationSyntax>().Single();
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
44
For Each node In context.Node.
DescendantNodes
()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (2)
297
.
DescendantNodes
() _
305
.
DescendantNodes
() _
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests.vb (1)
2103
Dim expr = tree.GetRoot().
DescendantNodes
().OfType(Of BinaryExpressionSyntax).First()
Microsoft.CodeAnalysis.VisualBasic.Features (9)
AddImport\VisualBasicAddImportFeatureService.vb (2)
148
node = CType(node, XmlCrefAttributeSyntax).Reference.
DescendantNodes
().OfType(Of IdentifierNameSyntax).FirstOrDefault()
150
node = CType(node, CrefReferenceSyntax).
DescendantNodes
().OfType(Of IdentifierNameSyntax).FirstOrDefault()
ChangeSignature\VisualBasicChangeSignatureService.vb (2)
617
.
DescendantNodes
(descendIntoTrivia:=True) _
691
Dim nodes = root.
DescendantNodes
()
EditAndContinue\SyntaxUtilities.vb (2)
226
Return ImmutableArray.CreateRange(body.
DescendantNodes
(AddressOf LambdaUtilities.IsNotLambda).
232
Return ImmutableArray.CreateRange(body.
DescendantNodes
(Function(n) TypeOf n IsNot ExpressionSyntax).
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
74
Dim fields = root.
DescendantNodes
(Function(n) n.Span.IntersectsWith(span)) _
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
49
Dim nodesToRemove = result.
DescendantNodes
(Function(n) n.ContainsAnnotations).Where(Function(n) n.HasAnnotation(s_removeAnnotation))
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
44
For Each node In context.Node.
DescendantNodes
()
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (3)
EditAndContinue\SyntaxUtilitiesTests.vb (3)
18
For Each oldNode In oldRoot.
DescendantNodes
().Where(Function(n) n.FullSpan.Length > 0)
68
Dim leftPosition = leftRoot.
DescendantNodes
().OfType(Of LiteralExpressionSyntax).ElementAt(2).SpanStart '0 within Console.WriteLine(0)
109
Dim leftPosition = leftRoot.
DescendantNodes
().OfType(Of LiteralExpressionSyntax).ElementAt(5).SpanStart '3 within Console.WriteLine(3)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (42)
Compilation\SemanticModelAPITests.vb (24)
69
Dim children = tree.GetCompilationUnitRoot().
DescendantNodes
()
111
Dim node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of LocalDeclarationStatementSyntax).Skip(1).First
151
Dim node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of LocalDeclarationStatementSyntax).Skip(1).First
193
Dim descendants = tree.GetCompilationUnitRoot().
DescendantNodes
()
495
Dim crefSyntax = root.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of CrefReferenceSyntax).Single()
592
Dim originalExpression = originalStatement.
DescendantNodes
().Where(Function(syntax) syntax.Kind = SyntaxKind.ObjectCreationExpression).FirstOrDefault()
596
speculatedExpression = speculatedStatement.
DescendantNodes
().OfType(Of CastExpressionSyntax).Single()
980
Dim lambdaExpressionHeader = speculatedStatement.
DescendantNodes
().OfType(Of LambdaHeaderSyntax)().FirstOrDefault()
1040
Dim rangeArg = root.
DescendantNodes
().OfType(Of RangeArgumentSyntax).Single()
1079
Dim rangeArg = root.
DescendantNodes
().OfType(Of RangeArgumentSyntax).Single()
1387
Dim localDecl = tree.GetRoot().
DescendantNodes
().OfType(Of LocalDeclarationStatementSyntax)().Single()
1707
Dim lambdaExpressionHeader = speculatedMethod.Statements(0).
DescendantNodes
().OfType(Of LambdaHeaderSyntax)().FirstOrDefault()
1982
Dim initializer = statementSyntax.
DescendantNodes
().Single(Function(n) n.ToString() = "Me.goo")
2017
Dim initializer = statementSyntax.
DescendantNodes
().Single(Function(n) n.ToString() = "Me.goo")
2777
Dim node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of MemberAccessExpressionSyntax).First()
2814
Dim node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of MemberAccessExpressionSyntax).First()
2850
Dim node = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of BinaryExpressionSyntax).First()
2945
Dim decl = root.
DescendantNodes
().
2986
Dim decl = root.
DescendantNodes
().
4025
Dim nodes = From n In tree.GetCompilationUnitRoot().
DescendantNodes
() Where n.Kind = SyntaxKind.IdentifierName Select CType(n, IdentifierNameSyntax)
4060
Dim assignments = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of AssignmentStatementSyntax)()
4507
Dim xmlString = root.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlStringSyntax).Single()
4586
For Each interp In root.
DescendantNodes
().OfType(Of InterpolatedStringExpressionSyntax)
4615
Dim node = root.
DescendantNodes
().OfType(Of QualifiedNameSyntax).Single()
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (2)
2854
Dim nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of ModifiedIdentifierSyntax)()
2888
Dim nodes = tree.GetCompilationUnitRoot().
DescendantNodes
().OfType(Of PropertyStatementSyntax)()
Compilation\SuppressAccessibilityChecksTests.vb (7)
55
Dim invocation = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
68
Dim invocation = semanticModel.SyntaxTree.GetRoot().
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
81
Dim invocation = syntaxTree.GetRoot().
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
88
Dim creationExpression = speculativeSemanticModel.GetTypeInfo(statement.
DescendantNodes
().OfType(Of ObjectCreationExpressionSyntax)().Single())
119
Dim expr = DirectCast(root.
DescendantNodes
().OfType(Of SingleLineLambdaExpressionSyntax)().Single().Body, ExpressionSyntax)
188
Dim invocation = syntaxTree.GetRoot().
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
257
.
DescendantNodes
() _
FlowAnalysis\IterationJumpYieldStatementTests.vb (1)
1345
Dim foreachBlock = tree.GetRoot.
DescendantNodes
.OfType(Of ForEachBlockSyntax).Single
Semantics\BinaryOperators.vb (3)
987
Dim nodes = (From node In tree.GetRoot().
DescendantNodes
()
1327
Dim nodes = (From node In tree.GetRoot().
DescendantNodes
()
1422
Dim nodes = (From node In tree.GetRoot().
DescendantNodes
()
Semantics\QueryExpressions_LookupSymbols.vb (1)
764
Dim node = tree.GetRoot().
DescendantNodes
().OfType(Of QueryExpressionSyntax)().First()
Semantics\QueryExpressions_SemanticModel.vb (1)
2963
Dim node = tree.GetRoot().
DescendantNodes
().OfType(Of QueryExpressionSyntax)().First()
Semantics\SyntaxTreeRootTests.vb (1)
79
Assert.Equal(tree, tree.GetRoot().
DescendantNodes
().OfType(Of ClassStatementSyntax)().Single().SyntaxTree)
Semantics\UnaryOperators.vb (2)
666
Dim nodes = (From node In tree.GetRoot().
DescendantNodes
()
818
Dim node1 = (From node In tree.GetRoot().
DescendantNodes
()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (6)
DocumentationComments\DocCommentTests.vb (4)
12248
Dim node1 = tree.GetRoot().
DescendantNodes
(descendIntoTrivia:=True).OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "f").Single()
12254
Dim node = tree.GetRoot().
DescendantNodes
(descendIntoTrivia:=True).OfType(Of TypeSyntax)().Where(Function(n) n.ToString() = "Integer").Single()
12308
Dim node1 = tree.GetRoot().
DescendantNodes
(descendIntoTrivia:=True).OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "f").Single()
12314
Dim node = tree.GetRoot().
DescendantNodes
(descendIntoTrivia:=True).OfType(Of TypeSyntax)().Where(Function(n) n.ToString() = "System.Int32").Single()
SymbolsTests\AnonymousDelegates\AnonymousDelegates_CreationAndEmit.vb (1)
490
Dim x = tree.GetRoot().
DescendantNodes
().OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "x").Single()
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (1)
2058
Dim x = tree.GetRoot().
DescendantNodes
().OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "x").Single()
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (32)
Parser\ParseAsyncTests.vb (5)
371
Dim asyncExpressions = tree.GetRoot().
DescendantNodes
.OfType(Of AwaitExpressionSyntax).ToArray()
375
Dim invocationExpression = tree.GetRoot().
DescendantNodes
.OfType(Of InvocationExpressionSyntax).ToArray()
379
Dim allParsedExpressions = tree.GetRoot().
DescendantNodes
.OfType(Of ExpressionSyntax)()
436
Dim awaitExpressions = tree.GetRoot().
DescendantNodes
.OfType(Of AwaitExpressionSyntax).ToArray()
440
Dim awaitParsedAsIdentifier = tree.GetRoot().
DescendantNodes
.OfType(Of IdentifierNameSyntax).Where(Function(id) id.Identifier.ValueText.Equals("Await")).ToArray()
Parser\ParseErrorTests.vb (1)
4763
Dim emptyStatement = tree.GetRoot().
DescendantNodes
().OfType(Of EmptyStatementSyntax).Single()
Parser\ParseExpression.vb (4)
2249
Dim nodes = tree.GetRoot().
DescendantNodes
().ToArray()
2266
Dim nodes = tree.GetRoot().
DescendantNodes
().ToArray()
2283
Dim nodes = tree.GetRoot().
DescendantNodes
().ToArray()
2301
Dim nodes = tree.GetRoot().
DescendantNodes
().ToArray()
Parser\ParseIteratorTests.vb (5)
152
Dim yieldStatements = tree.GetRoot().
DescendantNodes
.OfType(Of YieldStatementSyntax)().ToArray()
156
Dim methodSyntaxList = tree.GetRoot().
DescendantNodes
.OfType(Of MethodBlockBaseSyntax)().ToArray()
224
Dim yieldStatements = tree.GetRoot().
DescendantNodes
.OfType(Of YieldStatementSyntax)().ToArray()
362
Dim actual = From expression In tree.GetRoot().
DescendantNodes
()
409
Dim yieldStatements = tree.GetRoot().
DescendantNodes
.OfType(Of YieldStatementSyntax).ToArray()
Syntax\SyntaxListTests.vb (2)
261
Dim node = tree.GetRoot().
DescendantNodes
().OfType(Of CollectionInitializerSyntax)().First()
287
Dim node = tree.GetRoot().
DescendantNodes
().OfType(Of CollectionInitializerSyntax)().First()
Syntax\SyntaxRewriterTests.vb (7)
499
Dim xmlNode = oldRoot.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlEmptyElementSyntax)().Single()
532
Dim before = root.
DescendantNodes
().OfType(Of LiteralExpressionSyntax)().Single()
551
Dim invocation = root.
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
570
Dim invocation = root.
DescendantNodes
().OfType(Of InvocationExpressionSyntax)().Single()
636
Dim field = tree.GetRoot().
DescendantNodes
().OfType(Of FieldDeclarationSyntax).Single()
663
Dim field = tree.GetRoot().
DescendantNodes
().OfType(Of FieldDeclarationSyntax).Single()
686
Dim newRoot = root.RemoveNode(root.
DescendantNodes
().First(), SyntaxRemoveOptions.KeepDirectives)
TestSyntaxNodes.vb (8)
1286
expr.
DescendantNodes
().OfType(Of ExpressionSyntax)(),
1319
Dim expA = invocation.
DescendantNodes
().OfType(Of ExpressionSyntax).First(Function(n) n.ToString() = "a")
1356
Dim expA = invocation.
DescendantNodes
().OfType(Of ExpressionSyntax).First(Function(n) n.ToString() = "a")
2263
Dim identifier = root.
DescendantNodes
(descendIntoTrivia:=True).Single(Function(n) TypeOf n Is IdentifierNameSyntax)
2372
Dim e = expression.
DescendantNodes
().OfType(Of IdentifierNameSyntax)().First(Function(n) n.Identifier.ValueText = "e")
2389
Dim e = expression.
DescendantNodes
().OfType(Of IdentifierNameSyntax)().First(Function(n) n.Identifier.ValueText = "e")
2411
Dim nodes = statement.
DescendantNodes
().ToList()
2415
nodes = statement.
DescendantNodes
(descendIntoTrivia:=True).ToList()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (2)
297
.
DescendantNodes
() _
305
.
DescendantNodes
() _
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (6)
CodeGeneration\SyntaxGeneratorTests.vb (5)
1108
Dim node = tree.GetRoot().
DescendantNodes
().First()
2491
Dim summary = cls.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlElementSyntax)().First()
2511
Dim summary = cls.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlElementSyntax)().First()
2532
Dim text = cls.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlTextSyntax)().First()
2552
Dim text = cls.
DescendantNodes
(descendIntoTrivia:=True).OfType(Of XmlTextSyntax)().First()
Formatting\FormattingTests.vb (1)
4204
Dim propertyBlock = (Await document.GetSyntaxRootAsync()).
DescendantNodes
().OfType(Of PropertyBlockSyntax).Single()
Microsoft.CodeAnalysis.Workspaces (4)
Differencing\AbstractSyntaxComparer.cs (1)
106
foreach (var descendant in child.
DescendantNodes
(DescendIntoChildren))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
35
node = root.
DescendantNodes
(n => n.FullSpan.Contains(change)).LastOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
262
foreach (var node in containerDeclaration.
DescendantNodes
())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
260
currentNodeOrToken = newRoot.
DescendantNodes
().Single(c => c.HasAnnotation(marker));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
340
var decl = root.
DescendantNodes
().OfType<CS.Syntax.ClassDeclarationSyntax>().First();
Microsoft.CodeAnalysis.Workspaces.UnitTests (18)
CodeCleanup\CodeCleanupTests.cs (3)
302
var accessor = root.
DescendantNodes
().OfType<VisualBasic.Syntax.AccessorBlockSyntax>().Last();
309
var newAccessor = newRoot.
DescendantNodes
().OfType<VisualBasic.Syntax.AccessorBlockSyntax>().Last();
312
accessor = root.
DescendantNodes
().OfType<VisualBasic.Syntax.AccessorBlockSyntax>().Last();
FindReferencesTests.cs (4)
183
SyntaxNode declareMethod = tree.GetRoot().
DescendantNodes
().OfType<Microsoft.CodeAnalysis.VisualBasic.Syntax.DeclareStatementSyntax>().FirstOrDefault();
184
SyntaxNode normalMethod = tree.GetRoot().
DescendantNodes
().OfType<Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax>().ToList()[1];
222
var propertyStatement = tree.GetRoot().
DescendantNodes
().OfType<Microsoft.CodeAnalysis.VisualBasic.Syntax.PropertyStatementSyntax>().FirstOrDefault();
286
var methodlist = tree.GetRoot().
DescendantNodes
().OfType<Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax>().ToList();
SolutionTests\SolutionTests.cs (2)
3235
var classNode = syntaxRoot.
DescendantNodes
().OfType<CS.Syntax.ClassDeclarationSyntax>().Single();
3240
var classNode = syntaxRoot.
DescendantNodes
().OfType<VB.Syntax.ClassStatementSyntax>().Single();
SymbolKeyTests.cs (5)
620
var symbols = tree.GetRoot().
DescendantNodes
().OfType<CSharp.Syntax.InvocationExpressionSyntax>().Select(s => model.GetSymbolInfo(s).Symbol).ToList();
656
var symbols = tree.GetRoot().
DescendantNodes
().OfType<CSharp.Syntax.InvocationExpressionSyntax>().Select(s => model.GetSymbolInfo(s).GetAnySymbol()).ToList();
679
var symbols = tree.GetRoot().
DescendantNodes
().OfType<CSharp.Syntax.UsingDirectiveSyntax>().Select(s => model.GetDeclaredSymbol(s)).ToList();
1275
var node = root.
DescendantNodes
().OfType<CSharp.Syntax.GenericNameSyntax>().Single();
1571
foreach (var token in root.
DescendantNodes
())
SyntaxNodeTests.cs (4)
32
var node = root.
DescendantNodes
().OfType<VariableDeclaratorSyntax>().Single();
53
var nodes = root.
DescendantNodes
().Where(n => n is VariableDeclaratorSyntax or ClassDeclarationSyntax).ToList();
95
var classDecl = root.
DescendantNodes
().OfType<ClassDeclarationSyntax>().First();
96
var methodDecl = classDecl.
DescendantNodes
().OfType<MethodDeclarationSyntax>().First();
Microsoft.DotNet.GenFacades (2)
TypeParser.cs (2)
59
var allPublicTypes = root.
DescendantNodes
().OfType<BaseTypeDeclarationSyntax>()
73
var allPublicTypes = root.
DescendantNodes
().OfType<DelegateDeclarationSyntax>()
Microsoft.Gen.ContextualOptions.Unit.Tests (9)
EmitterTests.cs (9)
28
.
DescendantNodes
()
38
syntaxTree.GetRoot().
DescendantNodes
().OfType<StructDeclarationSyntax>().Single().Members.Single().Modifiers,
47
.
DescendantNodes
()
51
.
DescendantNodes
()
63
.
DescendantNodes
()
79
.
DescendantNodes
()
92
.
DescendantNodes
()
107
.
DescendantNodes
()
120
.
DescendantNodes
()
Microsoft.ML.InternalCodeAnalyzer (1)
BestFriendAnalyzer.cs (1)
66
foreach (var node in model.SyntaxTree.GetRoot().
DescendantNodes
(n => !n.IsKind(SyntaxKind.UsingDirective)))
Microsoft.VisualStudio.LanguageServices (2)
Progression\GraphNodeIdCreation.cs (1)
541
foreach (var node in currentNode.
DescendantNodes
())
Progression\GraphQueries\CallsGraphQuery.cs (1)
49
foreach (var syntaxNode in (await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false)).
DescendantNodes
())
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
136
var candidateUsing = SyntaxFactory.ParseCompilationUnit("using " + namespaceToImport + ";").
DescendantNodes
().OfType<UsingDirectiveSyntax>().FirstOrDefault();
Mvc.Api.Analyzers.Test (3)
ActualApiResponseMetadataFactoryTest.cs (3)
78
var returnStatement = methodSyntax.
DescendantNodes
().OfType<ReturnStatementSyntax>().First();
395
var returnStatement = methodSyntax.
DescendantNodes
().OfType<ReturnStatementSyntax>().First();
414
var returnStatement = methodSyntax.
DescendantNodes
().OfType<ReturnStatementSyntax>().First();
System.Windows.Forms.Analyzers.CodeFixes.CSharp (3)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (3)
101
if (root.
DescendantNodes
()
110
bool hasUsings = root.
DescendantNodes
()
126
.
DescendantNodes
()
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (3)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (3)
115
If root.
DescendantNodes
().
124
Dim hasImports As Boolean = root.
DescendantNodes
().
140
DescendantNodes
().