3094 references to GetRoot
IdeCoreBenchmarks (4)
SyntacticChangeRangeBenchmark.cs (4)
56
var newRoot = newTree.
GetRoot
();
65
var newRoot = newTree.
GetRoot
();
74
var newRoot = newTree.
GetRoot
();
83
var newRoot = newTree.
GetRoot
();
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 (1)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
33
var root = syntaxTree.
GetRoot
(cancellationToken);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
141
var syntaxRootNode = (CSharpSyntaxNode)syntaxTree.
GetRoot
();
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
141
var syntaxRootNode = (CSharpSyntaxNode)syntaxTree.
GetRoot
();
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
RequestDelegateGeneratorSuppressor.cs (1)
50
|| sourceTree.
GetRoot
().FindNode(location.SourceSpan) is not InvocationExpressionSyntax node
Microsoft.CodeAnalysis (18)
Compilation\Compilation.cs (1)
2499
diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_EncodinglessSyntaxTree, tree.
GetRoot
().GetLocation()));
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
1267
for (var node = location.SourceTree.
GetRoot
(cancellationToken).FindNode(location.SourceSpan, getInnermostNodeForTie: true);
1320
var root = tree.
GetRoot
(cancellationToken);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
166
for (var node = location.SourceTree.
GetRoot
().FindNode(location.SourceSpan, getInnermostNodeForTie: true);
SourceGeneration\GeneratedCodeUtilities.cs (1)
120
var root = tree.
GetRoot
(cancellationToken);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
72
.Select((info, cancellationToken) => getGlobalAliasesInCompilationUnit(syntaxHelper, info.Tree.
GetRoot
(cancellationToken)))
159
var compilationUnit = syntaxTree.
GetRoot
(cancellationToken);
SourceGeneration\SyntaxStore.cs (1)
89
var root = new Lazy<SyntaxNode>(() => tree.
GetRoot
(_cancellationToken));
Syntax\ICompilationUnitSyntax.cs (1)
11
/// any node returned by <see cref="SyntaxTree.
GetRoot
"/> where <see cref="SyntaxTree.HasCompilationUnitRoot"/>
Syntax\LineDirectiveMap.cs (1)
39
var syntaxRoot = (SyntaxNodeOrToken)syntaxTree.
GetRoot
();
Syntax\SyntaxDiffer.cs (4)
53
return GetTextChanges(before.
GetRoot
(), after.
GetRoot
());
89
return GetPossiblyDifferentTextSpans(before.
GetRoot
(), after.
GetRoot
());
Syntax\SyntaxNode.cs (1)
974
SyntaxNode? cuRoot = node.SyntaxTree?.
GetRoot
();
Syntax\SyntaxNodeExtensions.cs (1)
436
return node != null ? oldTree.WithRootAndOptions(node, oldTree.Options).
GetRoot
() : null;
Syntax\SyntaxTree.cs (1)
429
var root = this.
GetRoot
(cancellationToken);
Syntax\SyntaxTreeExtensions.cs (1)
22
var root = tree.
GetRoot
();
Microsoft.CodeAnalysis.CodeStyle (24)
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
43
ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.
GetRoot
(context.CancellationToken));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
48
var root = tree.
GetRoot
(context.CancellationToken);
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
50
var root = tree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
95
var root = namespaceDeclaration.SyntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
127
var root = tree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
126
var root = firstBlock.Syntax.SyntaxTree.
GetRoot
(context.CancellationToken);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
120
var root = tree.
GetRoot
(cancellationToken);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
22
var root = tree.
GetRoot
();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (4)
20
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindToken(location.SourceSpan.Start);
23
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan);
26
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan, getInnermostNodeForTie: getInnermostNodeForTie);
29
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan, findInsideTrivia, getInnermostNodeForTie);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
95
? ((ICompilationUnitSyntax)token.Parent!.SyntaxTree!.
GetRoot
(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (6)
122
var root = syntaxTree.
GetRoot
(cancellationToken);
133
var root = syntaxTree.
GetRoot
(cancellationToken);
170
var root = syntaxTree.
GetRoot
(cancellationToken);
208
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnRightOfPosition(
223
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnLeftOfPosition(
251
var root = syntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (3)
51
var operation = GetIndentationDataFor(tree.
GetRoot
(cancellationToken), token, position);
102
tree.
GetRoot
(cancellationToken),
167
baseToken = baseToken.SyntaxTree.
GetRoot
(cancellationToken).FindToken(textLine.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
55
Root = (TSyntaxRoot)tree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
139
return TryResolve(syntaxTree.
GetRoot
(cancellationToken), out node);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
527
var root = attributeToRemove.SyntaxTree.
GetRoot
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
53
var root = SyntaxTree.WithChangedText(text).
GetRoot
(cancellationToken);
Microsoft.CodeAnalysis.CSharp (42)
Binder\BinderFactory.BinderFactoryVisitor.cs (3)
109
if (compilationUnit != syntaxTree.
GetRoot
())
941
if (compilationUnit != syntaxTree.
GetRoot
())
1073
Debug.Assert(token == this.syntaxTree.
GetRoot
().GetLastToken());
Binder\InMethodBinder.cs (1)
248
Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.
GetRoot
().ContainsDiagnostics == true,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
1333
SyntaxNode syntax = CSharpSyntaxTree.Dummy.
GetRoot
();
3193
_binder.TryGetCollectionIterationType(CSharpSyntaxTree.Dummy.
GetRoot
(), t1, out elementType1);
3198
_binder.TryGetCollectionIterationType(CSharpSyntaxTree.Dummy.
GetRoot
(), t2, out elementType2);
CommandLine\CSharpCompiler.cs (1)
350
foreach (LineDirectiveTriviaSyntax directive in tree.
GetRoot
().GetDirectives(
Compilation\CSharpCompilation.cs (5)
2663
var node = info.Tree.
GetRoot
(cancellationToken).FindToken(info.Span.Start, findInsideTrivia: false).
3074
bool reportUnusedUsings = (!span.HasValue || span.Value == tree.
GetRoot
(cancellationToken).FullSpan) && ReportUnusedImportsInTree(tree);
3206
var root = syntaxTree.
GetRoot
(cancellationToken);
3651
CSharpSyntaxTree.Dummy.
GetRoot
(),
3788
var checksumDirectives = tree.
GetRoot
().GetDirectives(d => d.Kind() == SyntaxKind.PragmaChecksumDirectiveTrivia &&
Compilation\CSharpSemanticModel.cs (2)
1276
bool atEOF = position == fullEnd && position == this.SyntaxTree.
GetRoot
().FullSpan.End;
1280
token = (atEOF ? (CSharpSyntaxNode)this.SyntaxTree.
GetRoot
() : Root).FindTokenIncludingCrefAndNameAttributes(position);
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
59
var attributedNode = model.SyntaxTree.
GetRoot
().FindToken(position).Parent;
Compilation\SyntaxTreeSemanticModel.cs (1)
79
return (CSharpSyntaxNode)_syntaxTree.
GetRoot
();
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
34
finder.Visit(tree.
GetRoot
(cancellationToken));
CSharpExtensions.cs (1)
397
return (CompilationUnitSyntax)tree.
GetRoot
(cancellationToken);
Declarations\DeclarationTreeBuilder.cs (1)
96
return (RootSingleNamespaceDeclaration)builder.Visit(syntaxTree.
GetRoot
());
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
29
ComputeDeclarations(model, associatedSymbol: null, model.SyntaxTree.
GetRoot
(cancellationToken),
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
193
var token = semanticModel.SyntaxTree.
GetRoot
().FindToken(position);
247
var token = location.SourceTree.
GetRoot
().FindToken(PositionOpt);
Symbols\MethodSymbolExtensions.cs (1)
213
return (CSharpSyntaxNode)CSharpSyntaxTree.Dummy.
GetRoot
();
Symbols\RangeVariableSymbol.cs (1)
62
SyntaxToken token = _location.SourceTree.
GetRoot
().FindToken(_location.SourceSpan.Start);
Symbols\ReducedExtensionMethodSymbol.cs (1)
140
var syntax = (CSharpSyntaxNode)syntaxTree.
GetRoot
();
Symbols\Source\SourceAssemblySymbol.cs (1)
1559
var root = (CompilationUnitSyntax)tree.
GetRoot
();
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
1070
var root = matchingTree.
GetRoot
();
1291
var root = matchingTree.
GetRoot
();
1384
if (ReferenceEquals(returnTypeSyntax, CSharpSyntaxTree.Dummy.
GetRoot
()))
Symbols\Symbol.cs (2)
513
SyntaxToken token = location.SourceTree.
GetRoot
().FindToken(location.SourceSpan.Start);
529
SyntaxNode parent = location.SourceTree.
GetRoot
();
Symbols\SymbolExtensions.cs (1)
380
return (CSharpSyntaxNode)CSharpSyntaxTree.Dummy.
GetRoot
();
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
288
return (CSharpSyntaxNode)syntaxTree.
GetRoot
();
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
266
foreach (var global in ((CompilationUnitSyntax)tree.
GetRoot
(cancellationToken)).Members.OfType<GlobalStatementSyntax>())
Syntax\CSharpPragmaWarningStateMap.cs (1)
60
foreach (var d in syntaxTree.
GetRoot
().GetDirectives())
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (1)
71
var root = CloneNodeAsRoot((CSharpSyntaxNode)tree.
GetRoot
(cancellationToken));
Syntax\NullableContextStateMap.cs (1)
141
foreach (var d in tree.
GetRoot
().GetDirectives())
Syntax\SyntaxEquivalence.cs (2)
31
return AreEquivalent(before.
GetRoot
(), after.
GetRoot
(), ignoreChildNode, topLevel);
Syntax\SyntaxFactory.cs (1)
2331
var compilation = (CompilationUnitSyntax)tree.
GetRoot
();
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
62
var length = _syntaxTree.
GetRoot
().FullSpan.Length;
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
38
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
189
outermostBody = syntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
59
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
165
? location.SyntaxTree.
GetRoot
(cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
37
directive.FullSpan.End == syntaxTree.
GetRoot
(cancellationToken).FullSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
178
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
222
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position);
391
var token = syntaxTree.
GetRoot
(cancellationToken).FindToken(position, findInsideTrivia: true);
440
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
492
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position, findInsideTrivia: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
162
return syntaxTree.
GetRoot
(cancellationToken).FindTrivia(span.Start - 1, findInsideTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
331
? ((CompilationUnitSyntax)structure.SyntaxTree.
GetRoot
(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
28
var root = model.SyntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1108
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position, findInsideTrivia: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
191
var root = tree.
GetRoot
(cancellationToken);
204
var newDeclarationTypeNode = newTree.
GetRoot
(cancellationToken).GetAnnotatedNodes(annotation).Single();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
47
var root = diagnostic.Location.SourceTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
85
return (TypeDeclarationSyntax)tree.
GetRoot
(cancellationToken);
206
return contextTree?.
GetRoot
(cancellationToken).FindToken(contextLocation!.SourceSpan.Start).Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
33
var root = (CompilationUnitSyntax)contextNode.SyntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
430
if (syntaxTree.
GetRoot
(cancellationToken) is CompilationUnitSyntax compilationUnit &&
1987
if (syntaxTree.
GetRoot
(cancellationToken) is CompilationUnitSyntax compilationUnit &&
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
271
semanticModel.SyntaxTree.
GetRoot
(),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
CodeActions\PreviewTests.cs (1)
84
solution = solution.WithDocumentSyntaxRoot(_oldDocument.Id, CSharpSyntaxTree.ParseText(ChangedDocumentText, cancellationToken: cancellationToken).
GetRoot
(cancellationToken));
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
236
=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.
GetRoot
().GetFirstToken().GetLocation()));
Formatting\FormattingEngineTests.cs (2)
2221
var root = tree.
GetRoot
();
2539
var root = syntaxTree.
GetRoot
();
SymbolKey\SymbolKeyTestBase.cs (1)
252
var usingNodes = tree.
GetRoot
().DescendantNodes().OfType<UsingDirectiveSyntax>();
Utilities\CSharpServiceTestExtensions.cs (2)
46
return syntaxTree.
GetRoot
().DigToFirstNodeOfType<T>();
50
=> (syntaxTree.
GetRoot
() as CompilationUnitSyntax).Members.OfType<TypeDeclarationSyntax>().First();
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
251
var root = (CompilationUnitSyntax)tree.
GetRoot
();
708
Assert.True(syntaxTree.
GetRoot
().Width() > 0, "syntaxTree.GetRoot().Width should be > 0");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (182)
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 (40)
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);
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();
4918
syntaxTree.
GetRoot
()
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 (2)
37
var interpolatedStrings = tree.
GetRoot
().DescendantNodes().OfType<InterpolatedStringExpressionSyntax>().ToArray();
46
foreach (var token in tree.
GetRoot
().DescendantTokens().Where(t => t.Kind() != SyntaxKind.EndOfFileToken))
CodeGen\CodeGenLocalFunctionTests.cs (5)
146
var localFunction = tree.
GetRoot
().DescendantNodes().OfType<LocalFunctionStatementSyntax>().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 (1)
4276
var comparison = tree.
GetRoot
().DescendantNodes().OfType<BinaryExpressionSyntax>().Last();
CodeGen\CodeGenTupleTest.cs (60)
4024
var result = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "result").Single();
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);
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>();
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();
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();
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)
31
var root = syntaxTree.
GetRoot
();
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 (28)
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 (10)
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();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (618)
Attributes\AttributeTests.cs (10)
87
var nodes = Parse(aliases).
GetRoot
().DescendantNodes().OfType<UsingDirectiveSyntax>();
706
var root = tree.
GetRoot
();
747
var root = tree.
GetRoot
();
811
var root = tree.
GetRoot
();
853
var root = tree.
GetRoot
();
894
var root = tree.
GetRoot
();
933
var root = tree.
GetRoot
();
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();
4151
var root = tree.
GetRoot
();
4310
var localDeclaration = tree.
GetRoot
().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First();
Diagnostics\GetDiagnosticsTests.cs (7)
173
model.GetDiagnostics(tree1.
GetRoot
().FullSpan);
222
model.GetDiagnostics(tree1.
GetRoot
().FullSpan);
274
model.GetDiagnostics(tree1.
GetRoot
().FullSpan);
324
model.GetDiagnostics(tree.
GetRoot
().FullSpan);
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 (7)
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>().
10490
var previousAccessor = tree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().Single();
10493
var modifiedAccessor = modifiedTree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().Single();
10524
var previousAccessor = tree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().First();
10527
var modifiedAccessor = modifiedTree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().First();
FirstClassSpanTests.cs (4)
2823
var arg = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Single().Expression;
2856
var casts = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().ToImmutableArray();
5000
var aVariable = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
5003
var d1Access = tree.
GetRoot
().DescendantNodes().OfType<MemberAccessExpressionSyntax>()
FlowAnalysis\FlowTests.cs (1)
5841
var declarations = tree.
GetRoot
().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToImmutableArray();
FlowAnalysis\RegionAnalysisTests.cs (8)
5535
var root = tree.
GetRoot
();
5579
var root = tree.
GetRoot
();
5622
var root = tree.
GetRoot
();
6481
var root = tree.
GetRoot
();
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)
444
var invocation = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
700
var invocation = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
760
var accesses = tree.
GetRoot
().DescendantNodes().OfType<ElementAccessExpressionSyntax>().ToArray();
808
var creation = tree.
GetRoot
().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
979
var secondCtor = tree.
GetRoot
().DescendantNodes().OfType<ConstructorDeclarationSyntax>().Skip(ctorToForce).First();
2221
var invocation = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
2319
var invocation = tree.
GetRoot
().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First();
2491
var symbols = tree.
GetRoot
().DescendantNodes()
RefReadonlyParameterTests.cs (1)
1525
var local = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().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();
4770
var invocation = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
7534
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8257
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8328
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8412
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
8497
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
14234
var returnValue = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Last().Expression;
14310
var returnValue = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Last().Expression;
14383
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
14446
var cast = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Last().Expression;
14451
var value = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().Last().Expression;
14570
var cast = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Last().Expression;
14575
var value = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().Last().Expression;
14653
var nestedCollection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Last();
14742
var nestedCollection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Last();
15080
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
26013
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26139
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26253
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26311
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26382
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26464
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26530
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26591
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26661
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26836
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
26901
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "CreateCollection");
26957
var method = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
28620
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28664
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28710
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28754
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28797
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28840
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
28879
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Last();
28912
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
28946
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
28999
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
29065
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
29126
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
29202
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
29245
var collections = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().ToArray();
29292
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Last();
32304
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
32399
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
32441
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
32486
var collection = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().Single();
33465
var collectionExpression = tree.
GetRoot
().DescendantNodes().OfType<CollectionExpressionSyntax>().First();
33506
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 (75)
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>()
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();
20658
Assert.Equal(1, compilation.SyntaxTrees[0].
GetRoot
().DescendantNodesAndSelf().OfType<DeclarationExpressionSyntax>().Count());
21370
var e = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(id => id.Identifier.ValueText == "e").Single();
32232
var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single());
32272
var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single());
32312
var a = (IFieldSymbol)model.GetDeclaredSymbol(tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "a").Single());
32385
var bDecl = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single();
32483
var x1Decl = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>()
32521
var x1Decl = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>()
33506
var x = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "x").Single();
33694
var z1 = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "z1").First();
35179
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35218
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35262
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35293
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35332
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35364
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35400
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35439
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35469
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35506
var varType = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "var").Single();
35697
var foreachStatement = tree.
GetRoot
().DescendantNodes().OfType<ForEachStatementSyntax>().Single();
35852
var node = tree.
GetRoot
().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
35898
var node = tree.
GetRoot
().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
35982
var initializerSyntax = tree.
GetRoot
().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single();
36001
var blockBodySyntax = tree.
GetRoot
().DescendantNodes().OfType<BlockSyntax>().First();
36026
var expressionBodySyntax = tree.
GetRoot
().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First();
36049
var declarationSyntax = tree.
GetRoot
().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First();
36122
var expressionBodySyntax = tree.
GetRoot
().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First();
36146
var blockBodySyntax = tree.
GetRoot
().DescendantNodes().OfType<BlockSyntax>().First();
36170
var propertyExpressionBodySyntax = tree.
GetRoot
().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().ElementAt(1);
36175
var declarationSyntax = tree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().Single();
36230
var node3 = tree.
GetRoot
().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First();
36323
var node = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test3").Last();
36363
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36366
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
36409
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36412
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Skip(1).First();
36416
Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.
GetRoot
().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
36449
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36452
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
36491
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36494
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
36498
Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.
GetRoot
().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
36526
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36529
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
36564
var method = tree2.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
36567
var invocation = tree2.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
36571
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);
428
Assert.Empty(tree.
GetRoot
().DescendantNodes().OfType<GlobalStatementSyntax>());
459
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 (9)
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();
2160
foreach (var pat in tree.
GetRoot
().DescendantNodesAndSelf().OfType<PatternSyntax>())
2251
var patterns = tree.
GetRoot
().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray();
2295
var patterns = tree.
GetRoot
().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray();
2341
var patterns = tree.
GetRoot
().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray();
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 (2)
3252
var node = tree.
GetRoot
().DescendantNodes()
3283
var node = tree.
GetRoot
().DescendantNodes()
Semantics\PrimaryConstructorTests.cs (55)
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();
6090
var doc = tree.
GetRoot
().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().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();
20598
var typeDeclaration = tree.
GetRoot
().ChildNodes().OfType<TypeDeclarationSyntax>().Single();
20631
var root = tree.
GetRoot
();
20675
var root = tree.
GetRoot
();
20722
var root = tree.
GetRoot
();
20772
var root = tree.
GetRoot
();
Semantics\RecordTests.cs (52)
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();
1815
var root = comp.SyntaxTrees[0].
GetRoot
();
2489
var x = tree.
GetRoot
().DescendantNodes().OfType<AssignmentExpressionSyntax>().Last().Left;
8088
var root = tree.
GetRoot
();
8601
var root = tree.
GetRoot
();
8716
var root = tree.
GetRoot
();
8861
var root = tree.
GetRoot
();
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();
28186
var doc = tree.
GetRoot
().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().First();
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 (22)
AddImport\CSharpAddImportFeatureService.cs (1)
598
return (CompilationUnitSyntax)contextNode.SyntaxTree.
GetRoot
(cancellationToken);
Completion\CompletionProviders\Scripting\DirectiveCompletionProviderUtilities.cs (1)
16
var token = tree.
GetRoot
(cancellationToken).FindToken(position, findInsideTrivia: true);
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
94
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
182
currentExpression.SyntaxTree.
GetRoot
(cancellationToken), cancellationToken);
Debugging\BreakpointResolver.cs (1)
37
var token = tree.
GetRoot
(cancellationToken).FindToken(location.SourceSpan.Start);
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
32
_token = _syntaxTree.
GetRoot
(cancellationToken).FindToken(_position);
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
83
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
46
return syntaxTree.
GetRoot
(cancellationToken).FindToken(position).GetAncestor<MemberDeclarationSyntax>();
236
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnRightOfPosition(
248
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnLeftOfPosition(
EditAndContinue\BreakpointSpans.cs (1)
38
var root = tree.
GetRoot
(cancellationToken);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
147
identifierName.SyntaxTree.
GetRoot
(cancellationToken);
NavigationBar\CSharpNavigationBarItemService.cs (1)
137
nodesToVisit.Push(semanticModel.SyntaxTree.
GetRoot
(cancellationToken));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
38
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
189
outermostBody = syntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
59
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
165
? location.SyntaxTree.
GetRoot
(cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
47
var root = diagnostic.Location.SourceTree.
GetRoot
(cancellationToken);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
29
ComputeDeclarations(model, associatedSymbol: null, model.SyntaxTree.
GetRoot
(cancellationToken),
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
65
var updatedRoot = updatedSemanticModel.SyntaxTree.
GetRoot
(cancellationToken);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (2)
177
var root = updatedSemanticModel.SyntaxTree.
GetRoot
(cancellationToken);
190
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
EditAndContinue\BreakpointSpansTests.cs (1)
76
var root = tree.
GetRoot
();
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
55
var token = tree.
GetRoot
().FindToken(expected.Start);
EditAndContinue\Helpers\EditingTestBase.cs (5)
146
var match = SyntaxComparer.TopLevel.ComputeMatch(tree1.
GetRoot
(), tree2.
GetRoot
());
203
var root = tree.
GetRoot
();
219
? ((BaseMethodDeclarationSyntax)SyntaxFactory.SyntaxTree(declaration).
GetRoot
()).Body
220
: (BlockSyntax)SyntaxFactory.SyntaxTree(declaration.Body!).
GetRoot
();
EditAndContinue\SyntaxUtilitiesTests.cs (15)
21
var oldRoot = SyntaxFactory.ParseSyntaxTree(oldSource).
GetRoot
();
22
var newRoot = SyntaxFactory.ParseSyntaxTree(newSource).
GetRoot
();
86
").
GetRoot
();
104
").
GetRoot
();
132
").
GetRoot
();
154
").
GetRoot
();
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");
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");
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (85)
IOperation\IOperationTests.cs (10)
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();
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 (1)
706
var root = syntaxTree.
GetRoot
();
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 (7)
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");
15543
VerifyFlowGraph(comp, comp.SyntaxTrees[0].
GetRoot
(), expectedFlowGraph);
IOperation\IOperationTests_ISymbolInitializer.cs (1)
33
var nodes = tree.
GetRoot
().DescendantNodes().Where(n => n is VariableDeclarationSyntax || n is PropertyDeclarationSyntax).ToArray();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1025)
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 (2)
981
var root = syntaxTree.
GetRoot
();
1015
var root = syntaxTree.
GetRoot
();
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\BindingTests.cs (25)
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();
2723
.
GetRoot
()
2735
.
GetRoot
()
2779
.
GetRoot
()
2834
.
GetRoot
()
2846
.
GetRoot
()
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();
2967
var lambda = tree.
GetRoot
().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single();
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)
1813
var syntaxRoot = syntaxTree.
GetRoot
();
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 (1)
3521
var initializer = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single().Initializer.Value;
Semantics\DeconstructionTests.cs (6)
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 (33)
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();
19802
var declarator = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().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 (21)
41
var node = tree.
GetRoot
()
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()
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()
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 (48)
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();
2225
var invocationTypes = tree.
GetRoot
()
2282
var invocationTypes = tree.
GetRoot
()
2355
var invocationTypes = tree.
GetRoot
()
2429
var invocationTypes = tree.
GetRoot
()
2497
var invocationTypes = tree.
GetRoot
()
2594
var invocationTypes = tree.
GetRoot
()
2667
var invocationTypes = tree.
GetRoot
()
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();
3677
var paramTypes = syntaxTree.
GetRoot
().DescendantNodes()
3805
VariableDeclarationSyntax fieldDeclaration = syntaxTree.
GetRoot
().DescendantNodes().OfType<FieldDeclarationSyntax>().Single().Declaration;
3814
var localDeclaration = syntaxTree.
GetRoot
()
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 (46)
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();
4979
Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.
GetRoot
().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4980
Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.
GetRoot
().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
4984
Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.
GetRoot
().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4985
Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.
GetRoot
().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
Semantics\ImplicitObjectCreationTests.cs (2)
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\ImportsTests.cs (2)
113
var binder = comp.GetBinderFactory(tree).GetInNamespaceBinder((CSharpSyntaxNode)tree.
GetRoot
());
143
var compilationUnits = trees.Select(tree => (CompilationUnitSyntax)tree.
GetRoot
());
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 (4)
3153
speculativeModel.SyntaxTree.
GetRoot
()
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 (28)
164
var invocation = source.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
1874
var invocation = source.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
1974
var root = source.
GetRoot
();
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 (2)
4599
var descendentNodes = tree.
GetRoot
().DescendantNodes();
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 (42)
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();
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();
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");
7105
var root = syntaxTree.
GetRoot
();
8010
var lambdas = tree.
GetRoot
().DescendantNodes()
8058
var lambda = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().Single();
8118
var decls = tree.
GetRoot
().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().ToImmutableArray();
8157
var defaultValue = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().Single()
8360
var exprs = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray();
8393
var exprs = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray();
Semantics\LocalFunctionTests.cs (35)
348
var m = newTree.
GetRoot
()
353
var x = newTree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Single();
394
var a = tree.
GetRoot
().DescendantNodes()
404
var m = newTree.
GetRoot
()
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();
1763
var root = tree.
GetRoot
();
1838
var root = tree.
GetRoot
();
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>();
7451
return tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == identifier).Single().SpanStart;
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();
9552
var node = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>()
10172
var node = tree.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>()
Semantics\LookupTests.cs (10)
1501
var node = tree.
GetRoot
().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "m.M").Single();
1505
var node2 = (ExpressionSyntax)SyntaxFactory.SyntaxTree(node).
GetRoot
();
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 (8)
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();
1119
var book = (IdentifierNameSyntax)tree.
GetRoot
().DescendantTokens().Last(t => t.Text == "b").Parent;
1160
var author = (IdentifierNameSyntax)tree.
GetRoot
().DescendantTokens().Last(t => t.Text == "a").Parent;
1201
var bookResult = (IdentifierNameSyntax)tree.
GetRoot
().DescendantTokens().Last(t => t.Text == "bookResult").Parent;
1205
var authorResult = (IdentifierNameSyntax)tree.
GetRoot
().DescendantTokens().Last(t => t.Text == "authorResult").Parent;
Semantics\NameOfTests.cs (18)
685
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First();
711
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First();
746
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
793
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
830
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
866
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "a.Nested").OfType<ExpressionSyntax>().First();
912
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "A.Extension").OfType<ExpressionSyntax>().First();
945
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First();
977
var initializer = tree2.
GetRoot
().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single();
1017
return tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>()
1049
var initializer = tree2.
GetRoot
().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single();
1091
return tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>()
1131
var initializer = tree2.
GetRoot
().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single();
1174
return tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>()
1212
var initializer = tree2.
GetRoot
().DescendantNodes().OfType<EqualsValueClauseSyntax>().Single();
1255
return tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>()
1422
var node = tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "X1.Extension").OfType<ExpressionSyntax>().First();
3041
var root = tree.
GetRoot
();
Semantics\NativeIntegerTests.cs (12)
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();
Semantics\NullableContextTests.cs (15)
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;
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 (138)
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();
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();
146453
var root = tree.
GetRoot
();
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();
161287
var sections = syntaxTree.
GetRoot
().DescendantNodes().OfType<SwitchSectionSyntax>().ToImmutableArray();
Semantics\NullCoalesceAssignmentTests.cs (5)
36
var syntaxRoot = syntaxTree.
GetRoot
();
74
var syntaxRoot = syntaxTree.
GetRoot
();
117
var syntaxRoot = syntaxTree.
GetRoot
();
156
var syntaxRoot = syntaxTree.
GetRoot
();
182
var syntaxRoot = syntaxTree.
GetRoot
();
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()
3690
var root = tree.
GetRoot
();
3740
var root = tree.
GetRoot
();
3784
var root = tree.
GetRoot
();
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();
7329
var syntax = tree.
GetRoot
();
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()
11337
var negNode = tree.
GetRoot
().DescendantNodes().OfType<PrefixUnaryExpressionSyntax>().Single();
11418
var fieldInitializerOperations = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>()
Semantics\OverloadResolutionPerfTests.cs (1)
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 (2)
2272
var queryContinuation = tree.
GetRoot
().FindToken(sourceCode.IndexOf("into w", StringComparison.Ordinal)).Parent;
2325
var joinInto = tree.
GetRoot
().FindToken(sourceCode.IndexOf("into x8", StringComparison.Ordinal)).Parent;
Semantics\RawInterpolationTests_Handler.cs (2)
2900
var descendentNodes = tree.
GetRoot
().DescendantNodes();
3126
SyntaxNode syntax = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().Single();
Semantics\RecordStructTests.cs (21)
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();
3242
var doc = tree.
GetRoot
().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
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 (1)
50
var root = tree.
GetRoot
();
Semantics\RefFieldTests.cs (63)
11025
var decls = tree.
GetRoot
().DescendantNodes().OfType<LocalFunctionStatementSyntax>().ToArray();
11099
var delegateTypesAndLambdas = tree.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => getDelegateTypeAndLambda(model, d)).ToArray();
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();
16772
var root = syntaxTree.
GetRoot
();
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();
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 (4)
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();
1389
var node1 = (CompilationUnitSyntax)syntaxTree.
GetRoot
();
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 (1)
2718
var operation = model.GetOperation(tree.
GetRoot
());
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 (5)
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();
169
var invocation = syntaxTree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
228
speculativeModel.SyntaxTree.
GetRoot
()
Semantics\SwitchTests.cs (1)
1154
var node = syntaxTree.
GetRoot
().DescendantNodes().First(x => x.IsKind(SyntaxKind.SimpleMemberAccessExpression));
Semantics\SyntaxTreeRootTests.cs (2)
44
Assert.Equal(typeof(CompilationUnitSyntax), tree.
GetRoot
().GetType());
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\TopLevelStatementsTests.cs (99)
193
var unit1 = (CompilationUnitSyntax)tree1.
GetRoot
();
249
var symbolInfo = model1.GetSymbolInfo(tree1.
GetRoot
());
253
var typeInfo = model1.GetTypeInfo(tree1.
GetRoot
());
257
foreach (var globalStatement in tree1.
GetRoot
().DescendantNodes().OfType<GlobalStatementSyntax>())
318
var unit1 = (CompilationUnitSyntax)tree1.
GetRoot
();
356
var unit2 = (CompilationUnitSyntax)tree2.
GetRoot
();
400
var symbolInfo = model1.GetSymbolInfo(tree1.
GetRoot
());
404
var typeInfo = model1.GetTypeInfo(tree1.
GetRoot
());
408
foreach (var globalStatement in tree1.
GetRoot
().DescendantNodes().OfType<GlobalStatementSyntax>())
481
var localDecl = tree1.
GetRoot
().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
487
Assert.NotNull(model1.GetOperation(tree1.
GetRoot
()));
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();
507
Assert.NotNull(model2.GetOperation(tree2.
GetRoot
()));
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();
579
Assert.NotNull(model1.GetOperation(tree1.
GetRoot
()));
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();
1411
Assert.Null(model2.GetOperation(tree2.
GetRoot
()));
1425
nameRef = tree2.
GetRoot
().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1429
Assert.Null(model2.GetOperation(tree2.
GetRoot
()));
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();
1881
Assert.Null(model2.GetDeclaredSymbol((CompilationUnitSyntax)tree2.
GetRoot
()));
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();
4229
VerifyFlowGraph(comp, tree.
GetRoot
(),
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();
8791
(CSharpSyntaxNode)oldTree.
GetRoot
(), new[] { new TextChangeRange(new TextSpan(282, 0), 1) });
8799
var nodes1 = tree.
GetRoot
().DescendantNodesAndTokensAndSelf(descendIntoTrivia: true).ToArray();
8800
var nodes2 = fullParseTree.
GetRoot
().DescendantNodesAndTokensAndSelf(descendIntoTrivia: true).ToArray();
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);
9702
var root = tree.
GetRoot
();
Semantics\TypeOfTests.cs (1)
33
var node = (ObjectCreationExpressionSyntax)tree.
GetRoot
().DescendantNodes().Where(n => n.ToString() == "new C(0)").Last();
Semantics\UnsafeTests.cs (2)
6302
var root = tree.
GetRoot
();
6379
var root = tree.
GetRoot
();
SourceGeneration\GeneratorDriverTests.cs (7)
1145
var rootFromGetRoot = tree.
GetRoot
();
4306
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().
GetRoot
().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4307
var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.SyntaxTrees.First().
GetRoot
().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
4351
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", "//" + c.SyntaxTrees.First().
GetRoot
().ToFullString() + " generator1"); }); }).AsSourceGenerator();
4352
var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", "//" + c.SyntaxTrees.First().
GetRoot
().ToFullString() + " generator2"); }); }).AsSourceGenerator();
4375
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().
GetRoot
().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4376
var generator2 = new PipelineCallbackGenerator2((ctx) => { initWasCalled = true; ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.SyntaxTrees.First().
GetRoot
().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (362)
Compilation\CompilationAPITests.cs (4)
564
var rd1 = t1.
GetRoot
().GetDirectives().Cast<ReferenceDirectiveTriviaSyntax>().ToArray();
572
var rd2 = t2.
GetRoot
().GetDirectives().Cast<ReferenceDirectiveTriviaSyntax>().ToArray();
579
var rd3 = t3.
GetRoot
().GetDirectives().Cast<ReferenceDirectiveTriviaSyntax>().ToArray();
586
var rd4 = t4.
GetRoot
().GetDirectives().Cast<ReferenceDirectiveTriviaSyntax>().ToArray();
Compilation\GetSemanticInfoTests.cs (22)
2566
var expr = tree.
GetRoot
().DescendantNodes().OfType<ParameterSyntax>().First();
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();
4910
var equalsToken = tree.
GetRoot
().FindToken(position);
5478
var invocationSyntax = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().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;
5987
var root = tree.
GetRoot
();
6045
var typeParameters = tree.
GetRoot
().DescendantNodes().OfType<TypeParameterSyntax>().ToArray();
Compilation\GetUnusedImportDirectivesTests.cs (1)
93
var syntax = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single().Expression;
Compilation\ReferenceManagerTests.cs (2)
1353
var rd1 = (ReferenceDirectiveTriviaSyntax)t1.
GetRoot
().GetDirectives().Single();
1359
var rd2 = (ReferenceDirectiveTriviaSyntax)t2.
GetRoot
().GetDirectives().Single();
Compilation\SemanticModelAPITests.cs (39)
42
var root = tree.
GetRoot
();
109
SyntaxNode root = tree.
GetRoot
();
1728
var aliasDecl = tree.
GetRoot
().DescendantNodes().OfType<UsingDirectiveSyntax>().Single();
1739
var fieldDecl = tree.
GetRoot
().DescendantNodes().OfType<FieldDeclarationSyntax>().Single();
2310
var accessorSyntax = tree.
GetRoot
().DescendantNodes().OfType<AccessorDeclarationSyntax>().Single();
2313
var statementSyntax = tree.
GetRoot
().DescendantNodes().OfType<ReturnStatementSyntax>().Single();
3127
var syntax = tree.
GetRoot
().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single().
3259
var method1 = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single().Expression;
3300
var method1 = tree.
GetRoot
().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;
3417
var method1 = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single().Expression;
3458
var method1 = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single().Expression;
3499
var method1 = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single().Expression;
3741
var memberAccess = tree.
GetRoot
().DescendantNodes().OfType<MemberAccessExpressionSyntax>().Single();
3785
var localFunctionBody = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().Single();
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();
4059
var x = tree.
GetRoot
().FindToken(match.Index + 4).Parent;
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();
4424
var root = syntaxTree.
GetRoot
();
4457
var root = tree.
GetRoot
();
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");
4758
var identifier = tree.
GetRoot
().DescendantNodes(descendIntoTrivia: true).OfType<IdentifierNameSyntax>().First();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
5206
var node = tree.
GetRoot
().DescendantNodes().Single(node => node is IdentifierNameSyntax { Identifier: { ValueText: "b" } });
Compilation\SemanticModelGetSemanticInfoTests.cs (5)
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();
Compilation\UsedAssembliesTests.cs (1)
136
var unit = (CompilationUnitSyntax)tree.
GetRoot
();
DocumentationComments\CrefTests.cs (1)
6333
var nonCrefPosition = tree.
GetRoot
().DescendantTrivia().Single(t => t.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)).SpanStart;
SymbolDisplay\SymbolDisplayTests.cs (27)
5450
var invocation = tree.
GetRoot
().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
6433
var root = srcTree.
GetRoot
();
6476
var root = srcTree.
GetRoot
();
6510
var root = srcTree.
GetRoot
();
6572
var root = srcTree.
GetRoot
();
6605
var root = srcTree.
GetRoot
();
6666
var root = srcTree.
GetRoot
();
6699
var root = srcTree.
GetRoot
();
6744
var root = srcTree.
GetRoot
();
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();
8852
var preprocessingNameSyntax = tree.
GetRoot
().DescendantNodes(descendIntoTrivia: true)
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1005
var nodes = syntaxTree.
GetRoot
().DescendantNodes();
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)
2069
var castSyntax = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().Single();
2076
var forEachSyntax = tree.
GetRoot
().DescendantNodes().OfType<ForEachStatementSyntax>().Single();
2139
var syntax = tree.
GetRoot
().DescendantNodes().OfType<CastExpressionSyntax>().Single();
2173
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\EnumTests.cs (1)
353
var expr = tree.
GetRoot
().DescendantNodes().Single(n => n.Kind() == SyntaxKind.BitwiseNotExpression);
Symbols\ExtensionMethodTests.cs (5)
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 (16)
51
var paramType = syntaxTree.
GetRoot
()
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()
684
var paramType = syntaxTree.
GetRoot
()
1148
var functionPointerTypeSyntax = syntaxTree.
GetRoot
()
1259
var functionPointerTypeSyntax = syntaxTree.
GetRoot
()
1316
var baseNameSyntax = syntaxTree.
GetRoot
()
1427
var anonymousObjectCreations = syntaxTree.
GetRoot
()
1685
var mDeclSyntax = syntaxTree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Skip(2).Single();
1796
var methodDecls = syntaxTree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().ToArray();
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\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)
6955
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\DeclaringSyntaxNodeTests.cs (1)
140
var node = tree.
GetRoot
().FindToken(position).Parent.FirstAncestorOrSelf<TNode>();
Symbols\Source\DelegateTests.cs (2)
735
var root = syntaxTree.
GetRoot
();
762
var root = syntaxTree.
GetRoot
();
Symbols\Source\EventTests.cs (2)
435
var lambdaSyntax = tree.
GetRoot
().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
481
var lambdaSyntax = tree.
GetRoot
().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
Symbols\Source\ExternAliasTests.cs (1)
478
var root = tree.
GetRoot
();
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();
288
var tree = comp.SyntaxTrees.Single().
GetRoot
();
309
var tree = comp.SyntaxTrees.Single().
GetRoot
();
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 (105)
52
var root = syntaxTree.
GetRoot
();
86
var root = syntaxTree.
GetRoot
();
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>();
1093
var root = syntaxTree.
GetRoot
();
1120
var root = syntaxTree.
GetRoot
();
1208
var root = syntaxTree.
GetRoot
();
1260
var root = syntaxTree.
GetRoot
();
1358
var root = syntaxTree.
GetRoot
();
1438
var root = syntaxTree.
GetRoot
();
1510
var root = syntaxTree.
GetRoot
();
1566
var root = syntaxTree.
GetRoot
();
1623
var root = syntaxTree.
GetRoot
();
1666
var root = syntaxTree.
GetRoot
();
1709
var root = syntaxTree.
GetRoot
();
1848
var root = syntaxTree.
GetRoot
();
1891
var root = syntaxTree.
GetRoot
();
1936
var root = syntaxTree.
GetRoot
();
1983
var root = syntaxTree.
GetRoot
();
2044
var root = syntaxTree.
GetRoot
();
2087
var root = syntaxTree.
GetRoot
();
2130
var root = syntaxTree.
GetRoot
();
2173
var root = syntaxTree.
GetRoot
();
2215
var root = syntaxTree.
GetRoot
();
2245
var root = syntaxTree.
GetRoot
();
2280
var root = syntaxTree.
GetRoot
();
2324
var root = syntaxTree.
GetRoot
();
2365
var root = syntaxTree.
GetRoot
();
2410
var root = syntaxTree.
GetRoot
();
2450
var root = syntaxTree.
GetRoot
();
2498
var root = syntaxTree.
GetRoot
();
2543
var root = syntaxTree.
GetRoot
();
2592
var root = syntaxTree.
GetRoot
();
2626
var root = syntaxTree.
GetRoot
();
2660
var root = syntaxTree.
GetRoot
();
2698
var root = syntaxTree.
GetRoot
();
2734
var root = syntaxTree.
GetRoot
();
2780
var root = syntaxTree.
GetRoot
();
2823
var root = syntaxTree.
GetRoot
();
2872
var root = syntaxTree.
GetRoot
();
2913
var root = syntaxTree.
GetRoot
();
2954
var root = syntaxTree.
GetRoot
();
2996
var root = syntaxTree.
GetRoot
();
3038
var root = syntaxTree.
GetRoot
();
3098
var root = syntaxTree.
GetRoot
();
3145
var root = syntaxTree.
GetRoot
();
3190
var root = syntaxTree.
GetRoot
();
3255
var root = syntaxTree.
GetRoot
();
3307
var root = syntaxTree.
GetRoot
();
3356
var root = syntaxTree.
GetRoot
();
3403
var root = syntaxTree.
GetRoot
();
3448
var root = syntaxTree.
GetRoot
();
3485
var root = syntaxTree.
GetRoot
();
3534
var root = syntaxTree.
GetRoot
();
3595
var root = syntaxTree.
GetRoot
();
3658
var root = syntaxTree.
GetRoot
();
3697
var localFunctionBody = tree.
GetRoot
().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single();
3732
var localFunctionBody = tree.
GetRoot
().DescendantNodes().OfType<LambdaExpressionSyntax>().Single();
3766
var root = syntaxTree.
GetRoot
();
3805
var root = syntaxTree.
GetRoot
();
3851
var root = syntaxTree.
GetRoot
();
3910
var root = syntaxTree.
GetRoot
();
3975
var root = syntaxTree.
GetRoot
();
4044
var root = syntaxTree.
GetRoot
();
4111
var root = syntaxTree.
GetRoot
();
4174
var root = syntaxTree.
GetRoot
();
4208
var root = syntaxTree.
GetRoot
();
4242
var typeOf = syntaxTree.
GetRoot
().DescendantNodes().OfType<TypeOfExpressionSyntax>().Single();
4269
var root = syntaxTree.
GetRoot
();
4303
var root = syntaxTree.
GetRoot
();
4335
var exprs = tree.
GetRoot
().DescendantNodes().OfType<DefaultExpressionSyntax>().ToArray();
4365
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4393
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4421
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4451
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4481
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4511
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4543
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4576
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4604
var type = tree.
GetRoot
().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
4637
var initializer = tree.
GetRoot
().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single();
4668
var initializer = tree.
GetRoot
().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single();
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();
4902
var ctorDecl = tree.
GetRoot
()
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();
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;
5254
var root = tree.
GetRoot
();
5277
var root = tree.
GetRoot
();
5309
var root = tree.
GetRoot
();
5332
var root = tree.
GetRoot
();
5354
var root = tree.
GetRoot
();
5399
var root = tree.
GetRoot
();
5456
var root = tree.
GetRoot
();
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (1)
34
var root = syntaxTree.
GetRoot
();
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 (18)
40
var root = tree.
GetRoot
();
83
var root = tree.
GetRoot
();
123
var root = tree.
GetRoot
();
164
var root = tree.
GetRoot
();
410
var root = syntaxTree.
GetRoot
();
448
var root = syntaxTree.
GetRoot
();
479
var root = syntaxTree.
GetRoot
();
522
var root = syntaxTree.
GetRoot
();
553
var root = syntaxTree.
GetRoot
();
589
var root = syntaxTree.
GetRoot
();
623
var root = syntaxTree.
GetRoot
();
672
var root = syntaxTree.
GetRoot
();
724
var root = syntaxTree.
GetRoot
();
774
var root = syntaxTree.
GetRoot
();
825
var root = syntaxTree.
GetRoot
();
886
var root = syntaxTree.
GetRoot
();
933
var root = syntaxTree.
GetRoot
();
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\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 (98)
Diagnostics\DiagnosticTest.cs (1)
1981
var nodes = ParseWithRoundTripCheck(text).
GetRoot
().DescendantNodes(descendIntoTrivia: true);
Diagnostics\LineSpanDirectiveTests.cs (2)
443
foreach (var syntax in tree.
GetRoot
().DescendantNodesAndSelf())
463
var directives = tree.
GetRoot
().DescendantNodesAndSelf(descendIntoTrivia: true).OfType<DirectiveTriviaSyntax>();
Diagnostics\LocationsTests.cs (2)
561
var treeSpan = tree.
GetRoot
().FullSpan;
589
var treeSpan = tree.
GetRoot
().FullSpan;
IncrementalParsing\IncrementalParsingTests.cs (13)
492
Assert.True(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is AttributeSyntax));
493
Assert.False(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax));
502
Assert.False(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is AttributeSyntax));
503
Assert.True(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax));
524
Assert.False(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is AttributeSyntax));
525
Assert.True(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax));
534
Assert.True(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is AttributeSyntax));
535
Assert.False(tree.
GetRoot
().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax));
565
var localFunc1 = tree.
GetRoot
().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax);
582
var localFunc2 = tree.
GetRoot
().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax);
3054
var tempRoot = tempTree.
GetRoot
();
3110
WalkTreeAndVerify(incrTree.
GetRoot
(), fullTree.
GetRoot
());
LexicalAndXml\LexicalTests.cs (1)
3824
Assert.False(tree.
GetRoot
().DescendantTokens().Any(
Parsing\ExpressionParsingTests.cs (1)
3135
var root = SyntaxFactory.ParseSyntaxTree(text).
GetRoot
();
Parsing\FileModifierParsingTests.cs (1)
35
Validate(text, (CSharpSyntaxNode)tree.
GetRoot
(), expectedParsingDiagnostics);
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 (13)
7761
var toString = tree.
GetRoot
().ToFullString();
7776
var toString = tree.
GetRoot
().ToFullString();
7807
var toString = tree.
GetRoot
().ToFullString();
7841
var toString = tree.
GetRoot
().ToFullString();
7866
var toString = tree.
GetRoot
().ToFullString();
7893
var toString = tree.
GetRoot
().ToFullString();
7907
var toString = tree.
GetRoot
().ToFullString();
7919
var eofToken = ((CompilationUnitSyntax)tree.
GetRoot
()).EndOfFileToken;
7933
var root = SyntaxFactory.ParseSyntaxTree(source).
GetRoot
();
7954
var root = SyntaxFactory.ParseSyntaxTree(source).
GetRoot
();
7975
var root = SyntaxFactory.ParseSyntaxTree(source).
GetRoot
();
7998
var root = SyntaxFactory.ParseSyntaxTree(source).
GetRoot
();
8022
var root = SyntaxFactory.ParseSyntaxTree(source).
GetRoot
();
Parsing\RecordParsing.cs (2)
278
UsingNode((CSharpSyntaxNode)tree.
GetRoot
());
311
UsingNode((CSharpSyntaxNode)tree.
GetRoot
());
Parsing\StatementParsingTests.cs (4)
3411
var root = tree.
GetRoot
();
3438
var root = tree.
GetRoot
();
3461
var root = tree.
GetRoot
();
3532
tree.GetDiagnostics(tree.
GetRoot
()).Verify(
Syntax\FieldAndValueKeywordTests.cs (1)
1277
var expr = syntaxTree.
GetRoot
().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().Single().Expression;
Syntax\LambdaUtilitiesTests.cs (2)
51
var node = tree.
GetRoot
().FindNode(span.Value);
57
var methodDef = tree.
GetRoot
().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(d => d.Identifier.ValueText == "M").Single();
Syntax\SyntaxDiffingTests.cs (2)
284
var root = oldTree.
GetRoot
();
344
var root = oldTree.
GetRoot
();
Syntax\SyntaxEquivalenceTests.cs (5)
40
Assert.True(SyntaxFactory.AreEquivalent(node1, tree3.
GetRoot
(), ignoreChildNode));
492
VerifyEquivalent(tree1.
GetRoot
(), tree2.
GetRoot
(), ignoreChildNode: k => k == SyntaxKind.NullableDirectiveTrivia);
513
VerifyEquivalent(tree3.
GetRoot
(), tree4.
GetRoot
(), ignoreChildNode: k => k == SyntaxKind.NullableDirectiveTrivia);
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 (15)
46
var directives = tree.
GetRoot
().GetDirectives();
728
var root = tree.
GetRoot
();
1082
List<SyntaxToken> tokens = syntaxTree.
GetRoot
().DescendantTokens().ToList();
1085
SyntaxToken token = syntaxTree.
GetRoot
().GetFirstToken();
1187
List<SyntaxToken> tokens = syntaxTree.
GetRoot
().DescendantTokens().ToList();
1190
var token = syntaxTree.
GetRoot
().GetLastToken(includeZeroWidth: false); // skip EOF
1232
List<SyntaxToken> tokens = syntaxTree.
GetRoot
().DescendantTokens().ToList();
1235
SyntaxToken token = syntaxTree.
GetRoot
().GetFirstToken(includeZeroWidth: true);
1277
List<SyntaxToken> tokens = syntaxTree.
GetRoot
().DescendantTokens().ToList();
1823
var nodeOrToken = (SyntaxNodeOrToken)syntaxTree.
GetRoot
();
2055
var actualTokens = syntaxTree.
GetRoot
().DescendantTokens(syntaxTree.
GetRoot
().FullSpan);
3611
var root = (CompilationUnitSyntax)tree.
GetRoot
();
3661
var root = (CompilationUnitSyntax)tree.
GetRoot
();
3694
var root = (CompilationUnitSyntax)tree.
GetRoot
();
Syntax\SyntaxRewriterTests.cs (19)
317
Assert.Same(node, node.SyntaxTree.
GetRoot
());
326
Assert.Same(node1, node1.SyntaxTree.
GetRoot
());
330
Assert.Same(node2, node2.SyntaxTree.
GetRoot
());
342
Assert.Same(newRoot, newRoot.SyntaxTree.
GetRoot
());
354
Assert.Same(newRoot, newRoot.SyntaxTree.
GetRoot
());
362
var root = tree.
GetRoot
();
381
var root = tree.
GetRoot
();
400
var root = tree.
GetRoot
();
425
var root = tree.
GetRoot
();
443
var root = tree.
GetRoot
();
466
var root = tree.
GetRoot
();
493
var root = tree.
GetRoot
();
515
var root = tree.
GetRoot
();
528
var root = tree.
GetRoot
();
545
Assert.Same(rewrittenRoot, rewrittenRoot.SyntaxTree.
GetRoot
());
560
Assert.Same(ifStmt1, expr1.SyntaxTree.
GetRoot
());
578
Assert.Same(ifStmt2, expr2.SyntaxTree.
GetRoot
());
624
Assert.Same(ifStmt2, expr2.SyntaxTree.
GetRoot
());
650
var oldRoot = oldTree.
GetRoot
();
Syntax\SyntaxTreeTests.cs (4)
249
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString());
267
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString());
280
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString());
332
Assert.Equal(string.Empty, CSharpSyntaxTree.Create((CSharpSyntaxNode)oldTree.
GetRoot
()).FilePath);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (10)
CompilationTestUtils.cs (1)
456
var root = tree.
GetRoot
();
CSharpTestBase.cs (7)
774
return tree.
GetRoot
().DescendantNodes().OfType<T>().Where(e => e.ToString() == text);
1107
var parsedText = tree.
GetRoot
();
1337
bool hasTopLevelStatements = syntaxTrees.Any(s => s.
GetRoot
().ChildNodes().OfType<GlobalStatementSyntax>().Any());
1562
return GetSyntaxNodeList(syntaxTree.
GetRoot
(), null);
1695
string text = tree.
GetRoot
().ToFullString();
1739
string text = tree.
GetRoot
().ToFullString();
1754
var node = tree.
GetRoot
().FindToken(start).Parent;
SemanticModelTestBase.cs (2)
35
return GetExprSyntaxList(syntaxTree.
GetRoot
(), null);
141
var nameSyntaxToBind = tree.
GetRoot
().FindToken(position, findInsideTrivia: true).Parent as IdentifierNameSyntax;
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 (21)
Rename\CSharpRenameRewriterLanguageService.cs (2)
291
var speculativeTree = originalNode.SyntaxTree.
GetRoot
(_cancellationToken).ReplaceNode(originalNode, newNode);
306
speculativeTree = originalNode.SyntaxTree.
GetRoot
(_cancellationToken).ReplaceNode(originalNode, newNode);
Simplification\CSharpSimplificationService.cs (1)
188
var root = model.SyntaxTree.
GetRoot
(cancellationToken);
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
220
var root = (CompilationUnitSyntax)model.SyntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
37
directive.FullSpan.End == syntaxTree.
GetRoot
(cancellationToken).FullSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
178
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
222
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position);
391
var token = syntaxTree.
GetRoot
(cancellationToken).FindToken(position, findInsideTrivia: true);
440
var root = (CompilationUnitSyntax)syntaxTree.
GetRoot
(cancellationToken);
492
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position, findInsideTrivia: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
162
return syntaxTree.
GetRoot
(cancellationToken).FindTrivia(span.Start - 1, findInsideTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
331
? ((CompilationUnitSyntax)structure.SyntaxTree.
GetRoot
(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
28
var root = model.SyntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1108
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position, findInsideTrivia: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
191
var root = tree.
GetRoot
(cancellationToken);
204
var newDeclarationTypeNode = newTree.
GetRoot
(cancellationToken).GetAnnotatedNodes(annotation).Single();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
85
return (TypeDeclarationSyntax)tree.
GetRoot
(cancellationToken);
206
return contextTree?.
GetRoot
(cancellationToken).FindToken(contextLocation!.SourceSpan.Start).Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
33
var root = (CompilationUnitSyntax)contextNode.SyntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
430
if (syntaxTree.
GetRoot
(cancellationToken) is CompilationUnitSyntax compilationUnit &&
1987
if (syntaxTree.
GetRoot
(cancellationToken) is CompilationUnitSyntax compilationUnit &&
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4993
var root = tree.
GetRoot
();
CSharpSyntaxFactsServiceTests.cs (1)
19
var token = tree.
GetRoot
().FindToken(position);
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
122
var compilationUnit = (CompilationUnitSyntax)tree.
GetRoot
();
Microsoft.CodeAnalysis.EditorFeatures (3)
CommentSelection\AbstractCommentSelectionBase.cs (1)
150
var newRoot = oldSyntaxTree.WithChangedText(newText).
GetRoot
(cancellationToken);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
192
var documentWithOriginalName = document.WithSyntaxRoot(syntaxTreeWithOriginalName.
GetRoot
(cancellationToken));
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (1)
331
token = syntaxTree.
GetRoot
(cancellationToken).FindToken(point, true);
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 (13)
CodeFixes\CodeFixServiceTests.cs (1)
1202
var variableDeclarations = context.SemanticModel.SyntaxTree.
GetRoot
().DescendantNodes().OfType<CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax>();
CodeGeneration\CodeGenerationTests.cs (6)
543
testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.
GetRoot
().ReplaceNode(oldNode, newNode));
562
testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.
GetRoot
().ReplaceNode(declarationNode, newNode));
614
testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.
GetRoot
().ReplaceNode(declarationNode, updatedDeclarationNode));
886
return SemanticModel.SyntaxTree.
GetRoot
().FindNode(destSpan, getInnermostNodeForTie: true);
907
var token = semanticModel.SyntaxTree.
GetRoot
().FindToken(selection.Start);
919
var token = SemanticModel.SyntaxTree.
GetRoot
().FindToken(destSpan.Start);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (6)
923
context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.
GetRoot
().GetLocation())));
924
context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.
GetRoot
().GetLocation())));
925
context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().
GetRoot
().GetLocation())));
939
context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.
GetRoot
().GetLocation())));
940
context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.
GetRoot
().GetLocation())));
941
context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().
GetRoot
().GetLocation())));
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\PeekHelpers.cs (1)
50
var root = identifierLocation.SourceTree.
GetRoot
(cancellationToken);
Microsoft.CodeAnalysis.Features (19)
AddImport\References\Reference.cs (1)
93
var root = contextNode.SyntaxTree.
GetRoot
(cancellationToken);
ChangeSignature\AbstractChangeSignatureService.cs (1)
460
var root = tree.
GetRoot
();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
222
var root = nodeWithTokens.SyntaxTree.
GetRoot
();
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (1)
151
var root = _syntaxTree.
GetRoot
(_cancellationToken);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (2)
60
var token = syntaxTree.
GetRoot
(cancellationToken).FindToken(position, findInsideTrivia: true);
274
var trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(position, findInsideTrivia: false);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
97
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
57
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
178
document = document.WithSyntaxRoot(fieldDeclaration.SyntaxTree.
GetRoot
(cancellationToken).ReplaceNode(fieldDeclaration.GetSyntax(cancellationToken),
ExtractMethod\MethodExtractor.VariableSymbol.cs (1)
250
var token = tree.
GetRoot
(cancellationToken).FindToken(span.Start);
ExtractMethod\SelectionValidator.cs (1)
80
return IsFinalSpanSemanticallyValidSpan(semanticModel.SyntaxTree.
GetRoot
(cancellationToken), textSpan, returnStatements, cancellationToken);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
142
var root = linkedModel.SyntaxTree.
GetRoot
(cancellationToken);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
128
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
43
ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.
GetRoot
(context.CancellationToken));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
48
var root = tree.
GetRoot
(context.CancellationToken);
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
50
var root = tree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
95
var root = namespaceDeclaration.SyntaxTree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
127
var root = tree.
GetRoot
(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
126
var root = firstBlock.Syntax.SyntaxTree.
GetRoot
(context.CancellationToken);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
65
var oldRoot = oldTree.
GetRoot
();
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\RudeEditDiagnosticTests.cs (1)
23
var syntaxNode = tree.
GetRoot
();
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.LanguageServer.Protocol.UnitTests (3)
Diagnostics\NonLocalDiagnosticTests.cs (2)
93
var root = tree.
GetRoot
();
104
var root = tree.
GetRoot
();
Diagnostics\PullDiagnosticTests.cs (1)
137
context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Tree.
GetRoot
(context.CancellationToken).GetLocation())));
Microsoft.CodeAnalysis.Test.Utilities (24)
CommonTestBase.cs (2)
599
var root = model.SyntaxTree.
GetRoot
();
648
foreach (var node in model.SyntaxTree.
GetRoot
().DescendantNodes())
Compilation\CompilationExtensions.cs (3)
202
SyntaxNode root = tree.
GetRoot
();
290
var root = tree.
GetRoot
();
394
var nodes = tree.
GetRoot
().DescendantNodesAndSelf();
Diagnostics\CommonDiagnosticAnalyzers.cs (14)
71
var location = context.Tree.
GetRoot
().GetLocation();
106
var root = tree.
GetRoot
();
184
var root = tree.
GetRoot
();
261
var root = tree.
GetRoot
();
314
var root = tree.
GetRoot
();
943
_invalidLocation = treeInAnotherCompilation.
GetRoot
().GetLocation();
1081
context.ReportDiagnostic(Diagnostic.Create(Descriptor, tree.
GetRoot
().GetLocation()));
1107
Diagnostic.Create(Descriptor, context.SemanticModel.SyntaxTree.
GetRoot
().GetLocation())));
1665
ReportDiagnosticsCore(addDiagnostic, tree.
GetRoot
().GetLastToken().GetLocation(), tree.FilePath);
2600
var fields = context.Tree.
GetRoot
().DescendantNodes().OfType<CSharp.Syntax.FieldDeclarationSyntax>();
2697
context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.
GetRoot
().GetLocation()));
2849
var root = tree.
GetRoot
();
2934
context.RegisterSyntaxTreeAction(syntaxContext => HandleCallback(syntaxContext.Tree.
GetRoot
().GetLocation(), context.Compilation, syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken));
2946
context.RegisterSemanticModelAction(context => HandleCallback(context.SemanticModel.SyntaxTree.
GetRoot
().GetLocation(), context.SemanticModel.Compilation, context.ReportDiagnostic, context.CancellationToken));
Diagnostics\DiagnosticDescription.cs (2)
285
if (!_syntaxPredicate(d._location.SourceTree.
GetRoot
().FindToken(_location.SourceSpan.Start, true).Parent))
298
if (!d._syntaxPredicate(_location.SourceTree.
GetRoot
().FindToken(_location.SourceSpan.Start, true).Parent))
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (2)
205
var comments = context.Tree.
GetRoot
().DescendantTrivia()
244
foreach (var nodeOrToken in context.Tree.
GetRoot
().DescendantNodesAndTokens())
MarkedSource\SourceWithMarkedNodes.cs (1)
45
Root = parser(Source).
GetRoot
();
Microsoft.CodeAnalysis.UnitTests (3)
Diagnostics\OperationTests.cs (2)
310
var literal = tree.
GetRoot
().DescendantNodes().OfType<LiteralExpressionSyntax>().Single();
323
var classDecl = tree.
GetRoot
().DescendantNodes().OfType<ClassDeclarationSyntax>().Single();
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1397
var token = model.SyntaxTree.
GetRoot
().FindToken(pos);
Microsoft.CodeAnalysis.VisualBasic (21)
CommandLine\VisualBasicCompiler.vb (1)
273
For Each directive As ExternalSourceDirectiveTriviaSyntax In tree.
GetRoot
().GetDirectives(
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (1)
46
finder.Visit(tree.
GetRoot
(cancellationToken))
Compilation\SemanticModel.vb (4)
570
Dim atEOF As Boolean = (position = fullEnd AndAlso position = SyntaxTree.
GetRoot
().FullSpan.End)
614
Dim atEOF As Boolean = (position = fullEnd AndAlso position = SyntaxTree.
GetRoot
().FullSpan.End)
620
token = SyntaxTree.
GetRoot
().FindToken(position, True)
628
token = SyntaxTree.
GetRoot
().FindToken(position)
Compilation\SyntaxTreeSemanticModel.vb (1)
58
Return DirectCast(_syntaxTree.
GetRoot
(), VisualBasicSyntaxNode)
Compilation\VisualBasicCompilation.vb (2)
2316
If Not filterSpanWithinTree.HasValue OrElse filterSpanWithinTree.Value = tree.
GetRoot
(cancellationToken).FullSpan Then
2621
Dim checksumDirectives = tree.
GetRoot
().GetDirectives(Function(d) d.Kind = SyntaxKind.ExternalChecksumDirectiveTrivia AndAlso
Declarations\DeclarationTreeBuilder.vb (1)
29
Dim decl = DirectCast(builder.ForDeclaration(tree.
GetRoot
()), RootSingleNamespaceDeclaration)
src\Compilers\VisualBasic\BasicAnalyzerDriver\VisualBasicDeclarationComputer.vb (1)
20
ComputeDeclarationsCore(model, model.SyntaxTree.
GetRoot
(cancellationToken),
Symbols\Source\SourceAssemblySymbol.vb (1)
493
Dim compilationUnitSyntax = DirectCast(rootNs.Location.SourceTree.
GetRoot
(), CompilationUnitSyntax)
Symbols\Symbol.vb (1)
373
Dim token = CType(location.SourceTree.
GetRoot
().FindToken(location.SourceSpan.Start), SyntaxToken)
Syntax\SyntaxEquivalence.vb (2)
19
Return AreEquivalent(before.
GetRoot
(), after.
GetRoot
(), ignoreChildNode, topLevel)
Syntax\SyntaxFactory.vb (1)
1078
Dim compilationUnit As CompilationUnitSyntax = DirectCast(tree.
GetRoot
(), CompilationUnitSyntax)
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (1)
76
Dim root = CloneNodeAsRoot(CType(tree.
GetRoot
(cancellationToken), VisualBasicSyntaxNode))
Syntax\VisualBasicSyntaxTree.vb (1)
524
Return SyntaxDiffer.GetPossiblyDifferentTextSpans(oldTree.
GetRoot
(), Me.GetRoot())
Syntax\VisualBasicWarningStateMap.vb (1)
28
For Each d As DirectiveTriviaSyntax In syntaxTree.
GetRoot
().GetDirectives()
VisualBasicExtensions.vb (2)
260
Return DirectCast(syntaxTree.
GetRoot
(cancellationToken), VisualBasicSyntaxNode)
505
Return DirectCast(tree.
GetRoot
(), CompilationUnitSyntax)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
39
Return GetDirectiveInfo(syntaxTree.
GetRoot
(cancellationToken), cancellationToken).DirectiveMap.Keys.Where(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
750
Return tree.
GetRoot
().ReplaceNode(oldBlock, newBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (4)
122
Return FindTriviaToLeft(syntaxTree.
GetRoot
(cancellationToken), position)
305
Dim compilationUnit = TryCast(syntaxTree.
GetRoot
(cancellationToken), CompilationUnitSyntax)
353
directive.FullSpan.End = syntaxTree.
GetRoot
(cancellationToken).FullSpan.End
359
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(line.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
30
Dim root = model.SyntaxTree.
GetRoot
(cancellationToken)
73
Dim root = DirectCast(model.SyntaxTree.
GetRoot
(cancellationToken), CompilationUnitSyntax)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
14
Dim root = semanticModel.SyntaxTree.
GetRoot
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (1)
107
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(position)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (3)
src\Features\VisualBasicTest\Utils.vb (3)
86
Return syntaxTree.
GetRoot
().DigToFirstNodeOfType(Of T)()
98
Return syntaxTree.
GetRoot
().ChildNodesAndTokens().Where(Function(n) n.IsNode).
105
Return syntaxTree.
GetRoot
().ChildNodesAndTokens().Where(Function(n) n.IsNode).
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (4)
LineCommit\CommitFormatter.vb (2)
240
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(Math.Min(endPosition, syntaxTree.
GetRoot
(cancellationToken).FullSpan.End))
LineCommit\ContainingStatementInfo.vb (2)
60
Dim trivia = syntaxTree.
GetRoot
(cancellationToken).FindTrivia(point)
98
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(point, findInsideTrivia:=True)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests.vb (1)
2103
Dim expr = tree.
GetRoot
().DescendantNodes().OfType(Of BinaryExpressionSyntax).First()
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
SyntaxHelpers.vb (1)
202
Return DirectCast(DirectCast(syntaxTree.
GetRoot
(), CompilationUnitSyntax).Members.Single(), StatementSyntax)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
102
Dim token = tree.
GetRoot
(cancellationToken).FindToken(If(position <> tree.Length, position, Math.Max(0, position - 1)))
Completion\KeywordRecommenders\PreprocessorDirectives\PreprocessorHelpers.vb (1)
30
Visit(syntaxTree.
GetRoot
(cancellationToken))
Debugging\ProximityExpressionsGetter.Worker.vb (1)
27
Dim token = _syntaxTree.
GetRoot
(cancellationToken).FindToken(_position)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (1)
82
Dim root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken)
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (3)
27
Return syntaxTree.
GetRoot
(cancellationToken).FindToken(position).GetContainingMember()
234
Return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnRightOfPosition(
243
Return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnLeftOfPosition(
EditAndContinue\BreakpointSpans.vb (1)
30
Dim root = tree.
GetRoot
(cancellationToken)
ExtractMethod\VisualBasicSelectionValidator.vb (3)
102
Dim root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken)
193
semanticModel.SyntaxTree.
GetRoot
(cancellationToken), GetControlFlowSpan(selectionInfo), cancellationToken)
289
Dim root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
66
nodesToVisit.Push(DirectCast(semanticModel.SyntaxTree.
GetRoot
(cancellationToken), SyntaxNode))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
14
Dim root = semanticModel.SyntaxTree.
GetRoot
src\Compilers\VisualBasic\BasicAnalyzerDriver\VisualBasicDeclarationComputer.vb (1)
20
ComputeDeclarationsCore(model, model.SyntaxTree.
GetRoot
(cancellationToken),
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (15)
EditAndContinue\BreakpointSpansTests.vb (1)
74
Dim root = tree.
GetRoot
()
EditAndContinue\Helpers\EditingTestBase.vb (4)
217
Dim match = SyntaxComparer.TopLevel.ComputeMatch(tree1.
GetRoot
(), tree2.
GetRoot
())
267
Dim root = tree.
GetRoot
()
271
Return SyntaxUtilities.TryGetDeclarationBody(SyntaxFactory.SyntaxTree(declaration).
GetRoot
())
EditAndContinue\SyntaxUtilitiesTests.vb (6)
15
Dim oldRoot = SyntaxFactory.ParseSyntaxTree(oldSource).
GetRoot
()
16
Dim newRoot = SyntaxFactory.ParseSyntaxTree(newSource).
GetRoot
()
67
").
GetRoot
()
81
").
GetRoot
()
107
").
GetRoot
()
125
").
GetRoot
()
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
39
Dim node = tree.
GetRoot
().FindToken(expected.Key).Parent
Utils.vb (3)
86
Return syntaxTree.
GetRoot
().DigToFirstNodeOfType(Of T)()
98
Return syntaxTree.
GetRoot
().ChildNodesAndTokens().Where(Function(n) n.IsNode).
105
Return syntaxTree.
GetRoot
().ChildNodesAndTokens().Where(Function(n) n.IsNode).
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (36)
Compilation\SemanticModelAPITests.vb (8)
1039
Dim root = tree.
GetRoot
()
1078
Dim root = tree.
GetRoot
()
1387
Dim localDecl = tree.
GetRoot
().DescendantNodes().OfType(Of LocalDeclarationStatementSyntax)().Single()
2943
Dim root = tree.
GetRoot
()
2984
Dim root = tree.
GetRoot
()
3168
For Each name In From x In NameSyntaxFinder.FindNames(tree.
GetRoot
()) Where x.ToString() = "sv" Select x
3635
For Each name In From x In ExpressionSyntaxFinder.FindExpression(tree.
GetRoot
())
3824
For Each name In SyntaxNodeFinder.FindNodes(tree.
GetRoot
(), SyntaxKind.DeclareSubStatement)
Compilation\SuppressAccessibilityChecksTests.vb (6)
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()
188
Dim invocation = syntaxTree.
GetRoot
().DescendantNodes().OfType(Of InvocationExpressionSyntax)().Single()
234
]]>.Value).
GetRoot
()
256
speculativeModel.SyntaxTree.
GetRoot
() _
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\Conversions.vb (11)
102
Dim [nothing] = New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
103
Dim intZero = New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Create(0I), m13p(c))
104
Dim longZero = New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Create(0L), m13p(d))
271
Dim _nothing = New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
311
literal = New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), zero, integralType)
338
literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Null, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, convertibleType, Nothing)
369
literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, type1, Nothing)
627
New BoundLiteral(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing),
751
Dim zero = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing), ConversionKind.Widening, True, True, ConstantValue.Default(mv.Type.GetConstantValueTypeDiscriminator()), mv.Type, Nothing)
1121
Dim _nothing = New BoundLiteral(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
1188
New BoundLiteral(DirectCast(dummyTree.
GetRoot
(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing),
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\ScriptSemanticsTests.vb (1)
171
Dim node1 = DirectCast(syntaxTree.
GetRoot
(), CompilationUnitSyntax)
Semantics\SyntaxTreeRootTests.vb (2)
30
Assert.Equal(GetType(CompilationUnitSyntax), tree.
GetRoot
().GetType())
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 (42)
DocumentationComments\DocCommentTests.vb (7)
11911
Dim crefs = SyntaxNodeFinder.FindNodes(Of CrefReferenceSyntax)(tree.
GetRoot
(), SyntaxKind.CrefReference)
11916
Return SyntaxNodeFinder.FindNodes(Of CrefReferenceSyntax)(tree.
GetRoot
(), SyntaxKind.CrefReference)
12089
Dim token As SyntaxToken = tree.
GetRoot
().FindToken(position, True)
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 (32)
109
Dim declaratorQ = tree.
GetRoot
().FindToken(posQ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
116
Dim declaratorX = tree.
GetRoot
().FindToken(posX).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
123
Dim declaratorZ = tree.
GetRoot
().FindToken(posZ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
245
Dim declaratorW = tree.
GetRoot
().FindToken(posW).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
250
Dim declaratorZF = tree.
GetRoot
().FindToken(posZF).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
252
tree.
GetRoot
().FindToken(select1).GetLocation,
255
tree.
GetRoot
().FindToken(x2 - 2).GetLocation(),
256
tree.
GetRoot
().FindToken(y4 - 2).GetLocation())
260
Dim declaratorZL = tree.
GetRoot
().FindToken(posZL).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
262
tree.
GetRoot
().FindToken(select2).GetLocation,
265
tree.
GetRoot
().FindToken(x5 - 2).GetLocation(),
266
tree.
GetRoot
().FindToken(y5 - 2).GetLocation())
316
Dim declaratorT = tree.
GetRoot
().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
321
Dim declaratorA = tree.
GetRoot
().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
323
tree.
GetRoot
().FindToken(sub2).Parent.Parent.GetLocation,
326
tree.
GetRoot
().FindToken(x1 - 2).GetLocation(),
327
tree.
GetRoot
().FindToken(y1 - 2).GetLocation())
331
Dim declaratorB = tree.
GetRoot
().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
333
tree.
GetRoot
().FindToken(sub4).Parent.Parent.GetLocation,
336
tree.
GetRoot
().FindToken(x2 - 2).GetLocation(),
337
tree.
GetRoot
().FindToken(y2 - 2).GetLocation())
383
Dim declaratorT = tree.
GetRoot
().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
388
Dim declaratorA = tree.
GetRoot
().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
390
tree.
GetRoot
().FindToken(sub1).Parent.Parent.GetLocation,
393
tree.
GetRoot
().FindToken(x1 - 2).GetLocation(),
394
tree.
GetRoot
().FindToken(y1 - 2).GetLocation())
398
Dim declaratorB = tree.
GetRoot
().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
401
tree.
GetRoot
().FindToken(sub2).Parent.Parent.GetLocation,
404
tree.
GetRoot
().FindToken(x2 - 2).GetLocation(),
405
tree.
GetRoot
().FindToken(y2 - 2).GetLocation())
1982
stack.Push(tree.
GetRoot
())
2058
Dim x = tree.
GetRoot
().DescendantNodes().OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "x").Single()
SymbolsTests\MyBaseMyClassSemanticsTests.vb (1)
131
stack.Push(tree.
GetRoot
())
SymbolsTests\WithStatementSymbolsTests.vb (1)
284
stack.Push(tree.
GetRoot
())
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (125)
IncrementalParser\IncrementalParser.vb (23)
85
root = tree.
GetRoot
()
96
root = tree.
GetRoot
()
108
Assert.Equal(False, tree.
GetRoot
().ContainsDiagnostics)
710
Dim exp1 = newTree.
GetRoot
().ChildNodesAndTokens()(0).ChildNodesAndTokens()(1)
711
Dim inc1 = incTree.
GetRoot
().ChildNodesAndTokens()(0).ChildNodesAndTokens()(1)
748
Assert.Equal(False, oldTree.
GetRoot
().ContainsDiagnostics)
749
Assert.Equal(False, newTree.
GetRoot
().ContainsDiagnostics)
750
Assert.Equal(False, incTree.
GetRoot
().ContainsDiagnostics)
774
Assert.Equal(False, expectedTree.
GetRoot
().ContainsDiagnostics)
775
Assert.Equal(False, incrementalTree.
GetRoot
().ContainsDiagnostics)
799
Assert.Equal(True, expectedTree.
GetRoot
().ContainsDiagnostics)
800
Assert.Equal(True, incrementalTree.
GetRoot
().ContainsDiagnostics)
1129
Dim children1 = newTree.
GetRoot
().ChildNodesAndTokens()
1130
Dim children2 = fulltree.
GetRoot
().ChildNodesAndTokens()
1146
Assert.Equal(fullTree.
GetRoot
().ToFullString(), newTree.
GetRoot
().ToFullString())
1173
Assert.Equal(fulltree.
GetRoot
().ToFullString(), newTree.
GetRoot
().ToFullString())
1189
Assert.Equal(fullTree.
GetRoot
().ToFullString(), newTree.
GetRoot
().ToFullString())
1711
Dim tempRoot2 = tempTree2.
GetRoot
()
2577
Dim rootA = treeA.
GetRoot
()
2578
Dim rootB = treeB.
GetRoot
()
IncrementalParser\SyntaxDifferences.vb (2)
17
GatherNodes(oldTree.
GetRoot
(), hashSet)
20
GetRebuiltNodes(newTree.
GetRoot
(), hashSet, nodes)
Parser\DeclarationTests.vb (1)
16
Assert.False(tree.
GetRoot
().ContainsDiagnostics)
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\ParseDirectives.vb (2)
1262
Dim tk = tree.
GetRoot
().FindToken(text.IndexOf("class c2", StringComparison.Ordinal))
1265
tk = tree.
GetRoot
().FindToken(text.IndexOf("class c1", StringComparison.Ordinal))
Parser\ParseErrorTests.vb (4)
4736
Assert.Equal(code, tree.
GetRoot
().ToString())
4744
Assert.Equal(code, tree.
GetRoot
().ToString())
4754
Assert.Equal(code, tree.
GetRoot
().ToString())
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()
Parser\ParseStatements.vb (3)
4359
Dim tokens = tree.
GetRoot
().DescendantTokens().ToArray()
7875
Dim root = tree.
GetRoot
()
7902
Dim root = tree.
GetRoot
()
Parser\ParseXml.vb (1)
1916
Assert.Equal(code, tree.
GetRoot
().ToString())
Scanner\XmlScannerTests.vb (1)
375
Dim eof = tree.
GetRoot
().ChildTokens.Single()
Syntax\ManualTests.vb (2)
115
Dim node = VisualBasicSyntaxTree.ParseText(" ").
GetRoot
()
227
Dim token = tree.
GetRoot
().FindToken(text.Lines.Item(3).Start)
Syntax\SyntaxAnnotationTests.vb (33)
46
Dim fromNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
()
54
Dim fromNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
()
55
Dim toNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
()
64
Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
().DescendantTokens().First()
71
Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
().DescendantTokens().First()
79
Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
().DescendantTokens().First()
80
Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).
GetRoot
().DescendantTokens().First()
90
Dim toTrivia = GetAllTrivia(tree.
GetRoot
()).FirstOrDefault()
99
Dim fromTrivia = GetAllTrivia(tree.
GetRoot
()).FirstOrDefault()
107
Dim fromTrivia = GetAllTrivia(tree.
GetRoot
()).FirstOrDefault()
108
Dim toTrivia = GetAllTrivia(tree.
GetRoot
()).FirstOrDefault()
123
Dim matchingNodesOrTokens = tree.
GetRoot
().GetAnnotatedNodesAndTokens(annotation)
132
Dim matchingTrivia = tree.
GetRoot
().GetAnnotatedTrivia(annotation)
147
Dim node = GetAllNodesAndTokens(tree.
GetRoot
()).First(Function(t) t.IsNode).AsNode()
151
Dim newRoot = tree.
GetRoot
().ReplaceNode(node, annotatedNode)
178
Dim token = GetAllNodesAndTokens(tree.
GetRoot
()).First(Function(t) t.IsToken).AsToken()
182
Dim newRoot = tree.
GetRoot
().ReplaceToken(token, annotatedToken)
209
Dim trivia = GetAllTrivia(tree.
GetRoot
()).First()
213
Dim newRoot = tree.
GetRoot
().ReplaceTrivia(trivia, annotatedTrivia)
236
Dim newRoot = tree.
GetRoot
()
249
TestMultipleAnnotationsInTree(tree.
GetRoot
(), newRoot, annotations)
266
Dim firstNode = GetAllNodesAndTokens(tree.
GetRoot
()).First(Function(t) t.IsNode).AsNode()
271
Dim newRoot = tree.
GetRoot
().ReplaceNode(lastChildOfFirstNode, annotatedNode)
361
Dim sourceTreeRoot = DirectCast(rewriter.Visit(tree1.
GetRoot
()), VisualBasicSyntaxNode)
363
Dim destTreeRoot = CopyAnnotationsTo(sourceTreeRoot, tree2.
GetRoot
())
438
Dim currentRoot = tree.
GetRoot
()
467
Dim candidatePool = GetAllNodesAndTokens(tree.
GetRoot
())
477
Dim newRoot = Replace(tree.
GetRoot
(), firstItem, firstAnnotated)
519
For Each trivia In GetAllTrivia(tree.
GetRoot
())
522
Dim newRoot = tree.
GetRoot
().ReplaceTrivia(trivia, newTrivia)
531
For Each nodeOrToken In GetAllNodesAndTokens(tree.
GetRoot
())
537
newRoot = tree.
GetRoot
().ReplaceToken(nodeOrToken.AsToken(), newToken)
540
newRoot = tree.
GetRoot
().ReplaceNode(nodeOrToken.AsNode(), newNode)
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 (11)
479
Assert.Same(expression, tree.
GetRoot
())
498
Dim oldRoot = oldTree.
GetRoot
()
531
Dim root = tree.
GetRoot
()
550
Dim root = tree.
GetRoot
()
569
Dim root = tree.
GetRoot
()
594
Dim root = tree.
GetRoot
()
612
Dim root = tree.
GetRoot
()
636
Dim field = tree.
GetRoot
().DescendantNodes().OfType(Of FieldDeclarationSyntax).Single()
663
Dim field = tree.
GetRoot
().DescendantNodes().OfType(Of FieldDeclarationSyntax).Single()
685
Dim root = tree.
GetRoot
()
698
Dim root = tree.
GetRoot
()
Syntax\SyntaxSubmissionsTests.vb (1)
15
Dim compilation = DirectCast(tree.
GetRoot
(), CompilationUnitSyntax)
Syntax\SyntaxTreeTests.vb (4)
116
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString())
133
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString())
146
Assert.Equal(newRoot.ToString(), newTree.
GetRoot
().ToString())
193
Assert.Equal(String.Empty, VisualBasicSyntaxTree.Create(CType(oldTree.
GetRoot
, VisualBasicSyntaxNode), path:=Nothing).FilePath)
TestSyntaxNodes.vb (21)
1734
Dim node As SyntaxNode = tree.
GetRoot
()
1736
Assert.Equal(0, tree.
GetRoot
().FindToken(node.FullSpan.Length - 1).TrailingTrivia.Count)
1737
Assert.Equal(1, tree.
GetRoot
().FindToken(0).LeadingTrivia.Count)
1764
Dim node As SyntaxNode = tree.
GetRoot
()
1985
Dim openParenToken = CType(tree.
GetRoot
().FindToken(location + "List".Length), SyntaxToken)
2214
Dim tokens As List(Of SyntaxToken) = tree.
GetRoot
().DescendantTokens().ToList()
2216
Dim token As SyntaxToken = tree.
GetRoot
().GetFirstToken()
2231
token = tree.
GetRoot
().GetFirstToken()
2238
Dim lastToken = tree.
GetRoot
().DescendantTokens().Last
2255
Dim root = tree.
GetRoot
()
2352
Dim trivia = tree.
GetRoot
().FindTrivia(position)
2839
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
2885
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
2930
For Each node In tree.
GetRoot
.ChildNodes
3265
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
3339
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
3365
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
3389
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
3410
Dim trivia = tree.
GetRoot
().FindTrivia(4000)
3433
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
3452
Dim Root As CompilationUnitSyntax = CType(tree.
GetRoot
(), CompilationUnitSyntax)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (21)
CompilationTestUtils.vb (2)
661
Dim node = tree.
GetRoot
().FindToken(position)
1139
node = tree.
GetRoot
().FindToken(pos).Parent
ParserTestUtilities.vb (18)
80
Dim root = tree.
GetRoot
()
114
Dim root = tree.
GetRoot
()
225
Dim incTreeRoot = oldTree.
GetRoot
()
227
Dim newTreeRoot = newTree.
GetRoot
()
229
incTreeRoot = incTree.
GetRoot
()
246
VerifyParents(oldTree.
GetRoot
())
247
VerifyParents(newTree.
GetRoot
())
248
VerifyParents(incTree.
GetRoot
())
295
VerifySyntaxKinds(tree.
GetRoot
(), expected)
319
GetOccurrenceCount(kind, tree.
GetRoot
(), actualCount)
326
InternalTraverseAllNodes(tree.
GetRoot
())
336
If TryFindNodeOrToken(tree.
GetRoot
(), kind, occurrence, foundNode) Then
371
InternalVerifyNoWhitespaceInKeywords(tree.
GetRoot
())
377
Dim node = tree.
GetRoot
()
387
Dim node = tree.
GetRoot
()
397
Dim node = tree.
GetRoot
()
439
For Each child In tree.
GetRoot
().ChildNodesAndTokens()
447
Dim node = tree.
GetRoot
()
SyntaxTreeExtensions.vb (1)
69
Return node.
GetRoot
().Dump()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (16)
Rename\VisualBasicRenameRewriterLanguageService.vb (5)
190
Dim speculativeTree = originalNode.SyntaxTree.
GetRoot
(_cancellationToken).ReplaceNode(originalNode, newNode)
198
newNode = Me._speculativeModel.SyntaxTree.
GetRoot
(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotation).First()
212
speculativeTree = originalNode.SyntaxTree.
GetRoot
(_cancellationToken).ReplaceNode(originalNode, expandedNewNode)
222
probableRenameNode = Me._speculativeModel.SyntaxTree.
GetRoot
(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotation).First()
223
speculativeNewNode = Me._speculativeModel.SyntaxTree.
GetRoot
(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotationForSpeculativeNode).First()
Simplification\VisualBasicSimplificationService.vb (2)
128
nodeToSpeculate = speculativeModel.SyntaxTree.
GetRoot
()
165
Dim root = model.SyntaxTree.
GetRoot
(cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
39
Return GetDirectiveInfo(syntaxTree.
GetRoot
(cancellationToken), cancellationToken).DirectiveMap.Keys.Where(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
750
Return tree.
GetRoot
().ReplaceNode(oldBlock, newBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (4)
122
Return FindTriviaToLeft(syntaxTree.
GetRoot
(cancellationToken), position)
305
Dim compilationUnit = TryCast(syntaxTree.
GetRoot
(cancellationToken), CompilationUnitSyntax)
353
directive.FullSpan.End = syntaxTree.
GetRoot
(cancellationToken).FullSpan.End
359
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(line.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
30
Dim root = model.SyntaxTree.
GetRoot
(cancellationToken)
73
Dim root = DirectCast(model.SyntaxTree.
GetRoot
(cancellationToken), CompilationUnitSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (1)
107
Dim token = syntaxTree.
GetRoot
(cancellationToken).FindToken(position)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (7)
CodeGeneration\SyntaxGeneratorTests.vb (1)
1108
Dim node = tree.
GetRoot
().DescendantNodes().First()
Formatting\VisualBasicFormattingTestBase.vb (3)
65
spans.Add(syntaxTree.
GetRoot
().FullSpan)
74
spans.Add(syntaxTree.
GetRoot
().FullSpan)
80
AssertFormatWithTransformation(workspace.Services.SolutionServices, expected, syntaxTree.
GetRoot
(), spans, options, False)
VisualBasicSyntaxFactsServiceTests.vb (3)
510
Dim node = tree.
GetRoot
().FindNode(span)
528
Dim token = tree.
GetRoot
().FindToken(position)
544
Dim node = tree.
GetRoot
().FindToken(position).Parent
Microsoft.CodeAnalysis.Workspaces (31)
Classification\Classifier.cs (1)
90
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
65
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
Editing\DocumentEditor.cs (1)
36
var root = model.SyntaxTree.
GetRoot
(cancellationToken);
Editing\SymbolEditor.cs (2)
298
var newDeclaration = model.SyntaxTree.
GetRoot
(cancellationToken).GetCurrentNode(declaration);
489
var newDeclaration = model.SyntaxTree.
GetRoot
(cancellationToken).GetCurrentNode(decl);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
223
var root = semanticModel.SyntaxTree.
GetRoot
(cancellationToken);
Rename\RenameUtilities.cs (1)
47
var bindableToken = semanticModel.SyntaxTree.
GetRoot
(cancellationToken).FindToken(position, findInsideTrivia: true);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
120
var root = tree.
GetRoot
(cancellationToken);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
22
var root = tree.
GetRoot
();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (4)
20
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindToken(location.SourceSpan.Start);
23
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan);
26
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan, getInnermostNodeForTie: getInnermostNodeForTie);
29
=> location.GetSourceTreeOrThrow().
GetRoot
(cancellationToken).FindNode(location.SourceSpan, findInsideTrivia, getInnermostNodeForTie);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
95
? ((ICompilationUnitSyntax)token.Parent!.SyntaxTree!.
GetRoot
(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (6)
122
var root = syntaxTree.
GetRoot
(cancellationToken);
133
var root = syntaxTree.
GetRoot
(cancellationToken);
170
var root = syntaxTree.
GetRoot
(cancellationToken);
208
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnRightOfPosition(
223
return syntaxTree.
GetRoot
(cancellationToken).FindTokenOnLeftOfPosition(
251
var root = syntaxTree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (3)
51
var operation = GetIndentationDataFor(tree.
GetRoot
(cancellationToken), token, position);
102
tree.
GetRoot
(cancellationToken),
167
baseToken = baseToken.SyntaxTree.
GetRoot
(cancellationToken).FindToken(textLine.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
55
Root = (TSyntaxRoot)tree.
GetRoot
(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
139
return TryResolve(syntaxTree.
GetRoot
(cancellationToken), out node);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
527
var root = attributeToRemove.SyntaxTree.
GetRoot
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
53
var root = SyntaxTree.WithChangedText(text).
GetRoot
(cancellationToken);
Workspace\Solution\Document.cs (2)
166
/// to <see cref="SyntaxTree.
GetRoot
"/> or <see cref="SyntaxTree.GetRootAsync"/> may end up causing computation
251
return tree.
GetRoot
(cancellationToken);
Workspace\Solution\DocumentState.cs (2)
695
var newTreeContent = newTree.
GetRoot
().ToFullString();
698
var oldTreeContent = oldTree?.
GetRoot
().ToFullString();
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
62
var type = tree.
GetRoot
().DescendantTokens().First(t => t.ToString() == "class").Parent;
440
var type = tree.
GetRoot
().DescendantTokens().First(t => t.ToString() == "class").Parent;
2848
var type = tree.
GetRoot
().DescendantTokens().First(t => t.ToString() == "class").Parent;
Microsoft.CodeAnalysis.Workspaces.UnitTests (41)
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();
FormattingTests.cs (1)
86
var formattedRoot = Formatter.Format(tree.
GetRoot
(), workspace.Services.SolutionServices, options, CancellationToken.None);
SolutionTests\SolutionTests.cs (14)
307
var root = tree.
GetRoot
();
2483
var root = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From("class C {}", encoding: null, SourceHashAlgorithm.Sha1)).
GetRoot
();
3188
var root = tree.
GetRoot
();
3196
var root2 = tree2.
GetRoot
();
3402
Assert.Equal(text, docTree.
GetRoot
().ToString());
3423
Assert.Equal(text, docTree.
GetRoot
().ToString());
3432
var tree = CSharp.SyntaxFactory.ParseSyntaxTree("public class C {}").
GetRoot
(CancellationToken.None);
3687
var root = tree.
GetRoot
();
3704
var root2 = tree2.
GetRoot
();
3783
Assert.Same(tree2, tree2.
GetRoot
().SyntaxTree);
3811
Assert.Same(tree3, tree3.
GetRoot
().SyntaxTree);
3818
var tree4 = tree.WithRootAndOptions(tree.
GetRoot
(), newOptions);
3822
Assert.Same(tree4, tree4.
GetRoot
().SyntaxTree);
3829
Assert.Same(tree, tree.WithRootAndOptions(tree.
GetRoot
(), tree.Options));
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();
1274
var root = tree.
GetRoot
();
1497
GetAllSymbols(model, model.SyntaxTree.
GetRoot
(), list, predicate);
SyntaxNodeTests.cs (2)
30
var root = tree.
GetRoot
();
51
var root = tree.
GetRoot
();
SyntaxPathTests.cs (12)
81
var root = tree.
GetRoot
();
106
var root = tree.
GetRoot
();
120
var root = tree.
GetRoot
();
147
var namespaceDecl = (NamespaceDeclarationSyntax)(tree.
GetRoot
() as CompilationUnitSyntax).Members[0];
185
var namespaceDecl = (NamespaceDeclarationSyntax)(tree.
GetRoot
() as CompilationUnitSyntax).Members[0];
218
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
250
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
278
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
309
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
338
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
377
var namespaceDecl = (NamespaceDeclarationSyntax)((CompilationUnitSyntax)tree.
GetRoot
()).Members[0];
399
var root = (CompilationUnitSyntax)tree.
GetRoot
();
UtilityTest\FormattingRangeHelperTests.cs (3)
19
var root = SyntaxFactory.ParseSyntaxTree("{Foo();}").
GetRoot
();
29
var root = SyntaxFactory.ParseSyntaxTree("{Fizz();\nBuzz();}").
GetRoot
();
39
var token = SyntaxFactory.ParseSyntaxTree("else\nFoo();").
GetRoot
().GetFirstToken();
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
88
SyntaxNode root = rewriter.Visit(syntaxTree.
GetRoot
());
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
EmitterTests.cs (4)
38
syntaxTree.
GetRoot
().DescendantNodes().OfType<StructDeclarationSyntax>().Single().Members.Single().Modifiers,
62
.
GetRoot
()
91
.
GetRoot
()
119
.
GetRoot
()
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
36
ISymbol diagnosedSymbol = model.GetDeclaredSymbol(diagnostic.Location.SourceTree.
GetRoot
(context.CancellationToken).FindNode(diagnostic.Location.SourceSpan), context.CancellationToken);
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
188
var syntaxNode = tree.
GetRoot
();
Microsoft.ML.InternalCodeAnalyzer (2)
BestFriendAnalyzer.cs (1)
66
foreach (var node in model.SyntaxTree.
GetRoot
().DescendantNodes(n => !n.IsKind(SyntaxKind.UsingDirective)))
RelaxTestNamingSuppressor.cs (1)
41
var root = tree.
GetRoot
(context.CancellationToken);
Microsoft.VisualStudio.LanguageServices (2)
Venus\ContainedLanguageCodeSupport.cs (2)
211
var destinationType = syntaxFacts.GetContainingTypeDeclaration(targetSyntaxTree.
GetRoot
(cancellationToken), position);
224
var newRoot = targetSyntaxTree.
GetRoot
(cancellationToken).ReplaceNode(destinationType, newType);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
CodeModel\CSharp\SyntaxNodeKeyTests.vb (1)
241
Dim node = tree.
GetRoot
().FindToken(cursorPosition).Parent
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Help\VisualBasicHelpContextService.vb (2)
41
Dim token = tree.
GetRoot
(cancellationToken).FindToken(span.Start, findInsideTrivia:=True)
53
Dim trivia = tree.
GetRoot
(cancellationToken).FindTrivia(span.Start, findInsideTrivia:=True)
Mvc.Api.Analyzers.Test (4)
ActualApiResponseMetadataFactoryTest.cs (4)
77
var methodSyntax = syntaxTree.
GetRoot
().FindNode(method.Locations[0].SourceSpan);
374
var methodSyntax = (MethodDeclarationSyntax)syntaxTree.
GetRoot
().FindNode(method.Locations[0].SourceSpan);
394
var methodSyntax = syntaxTree.
GetRoot
().FindNode(method.Locations[0].SourceSpan);
413
var methodSyntax = syntaxTree.
GetRoot
().FindNode(method.Locations[0].SourceSpan);