3793 references to GetRoot
Analyzer.Utilities.UnitTests (1)
GenerateDocumentationAndConfigFiles (23)
IdeCoreBenchmarks (4)
Metrics (21)
Metrics.Legacy (21)
Microsoft.Analyzers.Extra (1)
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
Microsoft.CodeAnalysis (18)
Microsoft.CodeAnalysis.Analyzers (23)
Microsoft.CodeAnalysis.AnalyzerUtilities (21)
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
Microsoft.CodeAnalysis.CodeStyle (27)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp (45)
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (12)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (182)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (29)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (894)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Features (24)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (85)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1107)
Semantics\GlobalUsingDirectiveTests.cs (46)
3842var ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3844var aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3868ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3870aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3890aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3899ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3901aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3918aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3932ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3934aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3952ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3954aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3968aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3977ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
3979aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
3990aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4004ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4006aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4024ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4026aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4040aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4049ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4051aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4062aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4076ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4078aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4090ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4092aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4100aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4111ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4113aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4133ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4135aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4149ext = tree.GetRoot().DescendantNodes().OfType<ExternAliasDirectiveSyntax>().ToArray();
4151aliases = tree.GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>().ToArray();
4243var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4251node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4279node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4287node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4295node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4303node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4315node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Single();
4979Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4980Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
4984Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4985Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
Semantics\TopLevelStatementsTests.cs (99)
194var unit1 = (CompilationUnitSyntax)tree1.GetRoot();
250var symbolInfo = model1.GetSymbolInfo(tree1.GetRoot());
254var typeInfo = model1.GetTypeInfo(tree1.GetRoot());
258foreach (var globalStatement in tree1.GetRoot().DescendantNodes().OfType<GlobalStatementSyntax>())
319var unit1 = (CompilationUnitSyntax)tree1.GetRoot();
357var unit2 = (CompilationUnitSyntax)tree2.GetRoot();
401var symbolInfo = model1.GetSymbolInfo(tree1.GetRoot());
405var typeInfo = model1.GetTypeInfo(tree1.GetRoot());
409foreach (var globalStatement in tree1.GetRoot().DescendantNodes().OfType<GlobalStatementSyntax>())
482var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
488Assert.NotNull(model1.GetOperation(tree1.GetRoot()));
493var localFuncRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
501var localRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single();
508Assert.NotNull(model2.GetOperation(tree2.GetRoot()));
534var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
541var localRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray();
574var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
580Assert.NotNull(model1.GetOperation(tree1.GetRoot()));
585var localFuncRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
592var localRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").Single();
699var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
700var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "s").Single();
872var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single());
874Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol);
878var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single());
880Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol);
986var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First());
988Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").First()).Symbol);
990var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).Single());
992Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Skip(1).Single()).Symbol);
1041var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First());
1043Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol);
1408var nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1412Assert.Null(model2.GetOperation(tree2.GetRoot()));
1426nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
1430Assert.Null(model2.GetOperation(tree2.GetRoot()));
1521var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "c").Single();
1593foreach (var id in tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>())
1599foreach (var id in tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>())
1686var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
1707var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
1859var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
1882Assert.Null(model2.GetDeclaredSymbol((CompilationUnitSyntax)tree2.GetRoot()));
1883var nameRefs = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2085var localDecl = tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single();
2101var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2249var localDecl = tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single();
2267var nameRefs = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2427var labelDecl = tree1.GetRoot().DescendantNodes().OfType<LabeledStatementSyntax>().Single();
2447var nameRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").ToArray();
2920var nameRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single();
2925nameRef = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2").Single();
2942nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias2" && !id.Parent.IsKind(SyntaxKind.NameEquals)).Single();
2947nameRef = tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "alias1").Single();
3942var nameRefs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray();
4091var nameRefs = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").ToArray();
4216var declarator = tree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single();
4217var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local").Single();
4230VerifyFlowGraph(comp, tree.GetRoot(),
4511var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single());
4513Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol);
4517var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First());
4519Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol);
4575var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First());
4577Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").First()).Symbol);
4579var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Skip(1).First());
4581Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Skip(1).Single()).Symbol);
4624var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First());
4626Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol);
4894var declarator = tree.GetRoot().DescendantNodes().OfType<LabeledStatementSyntax>().Single();
4895var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single();
4951var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LabeledStatementSyntax>().Single());
4953Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol);
4957var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LabeledStatementSyntax>().Single());
4960Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol);
4979var declarator = tree.GetRoot().DescendantNodes().OfType<LabeledStatementSyntax>().Single();
4980var reference = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single();
6031var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
6035var localRefs = tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "i").ToArray();
6047localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().ElementAt(1);
6087var localFunctions = syntaxTree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().ToList();
6161.GetDeclaredSymbol(syntaxTree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single())
6233var invocation = syntaxTree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().Single();
6277var localDecl = syntaxTree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
6278var localRef = syntaxTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
6317var localDecl = syntaxTree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
6318var localRef = syntaxTree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
6367var localDecl = syntaxTree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single();
6369var localRef = syntaxTree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single();
8579var invocations = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().ToArray();
8652var id = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single();
8674var id = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single();
8696var id = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "ar").Single();
8792(CSharpSyntaxNode)oldTree.GetRoot(), new[] { new TextChangeRange(new TextSpan(282, 0), 1) });
8800var nodes1 = tree.GetRoot().DescendantNodesAndTokensAndSelf(descendIntoTrivia: true).ToArray();
8801var nodes2 = fullParseTree.GetRoot().DescendantNodesAndTokensAndSelf(descendIntoTrivia: true).ToArray();
9678var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().First(id => id.Identifier.Text == "var");
9682Assert.Equal(OperationKind.Literal, model.GetOperation(tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Single()).Kind);
9703var root = tree.GetRoot();
SourceGeneration\GeneratorDriverTests.cs (7)
1145var rootFromGetRoot = tree.GetRoot();
4436var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4437var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
4481var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", "//" + c.SyntaxTrees.First().GetRoot().ToFullString() + " generator1"); }); }).AsSourceGenerator();
4482var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", "//" + c.SyntaxTrees.First().GetRoot().ToFullString() + " generator2"); }); }).AsSourceGenerator();
4505var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4506var 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 (368)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (98)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (10)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (23)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (15)
Microsoft.CodeAnalysis.Features (26)
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
Microsoft.CodeAnalysis.Features.UnitTests (4)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
Microsoft.CodeAnalysis.PublicApiAnalyzers (21)
Microsoft.CodeAnalysis.ResxSourceGenerator (21)
Microsoft.CodeAnalysis.Test.Utilities (24)
Diagnostics\CommonDiagnosticAnalyzers.cs (14)
71var location = context.Tree.GetRoot().GetLocation();
106var root = tree.GetRoot();
184var root = tree.GetRoot();
261var root = tree.GetRoot();
314var root = tree.GetRoot();
943_invalidLocation = treeInAnotherCompilation.GetRoot().GetLocation();
1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, tree.GetRoot().GetLocation()));
1107Diagnostic.Create(Descriptor, context.SemanticModel.SyntaxTree.GetRoot().GetLocation())));
1665ReportDiagnosticsCore(addDiagnostic, tree.GetRoot().GetLastToken().GetLocation(), tree.FilePath);
2600var fields = context.Tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.FieldDeclarationSyntax>();
2697context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.GetRoot().GetLocation()));
2849var root = tree.GetRoot();
2934context.RegisterSyntaxTreeAction(syntaxContext => HandleCallback(syntaxContext.Tree.GetRoot().GetLocation(), context.Compilation, syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken));
2946context.RegisterSemanticModelAction(context => HandleCallback(context.SemanticModel.SyntaxTree.GetRoot().GetLocation(), context.SemanticModel.Compilation, context.ReportDiagnostic, context.CancellationToken));
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic (21)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (8)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (4)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (13)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (15)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (35)
Semantics\Conversions.vb (11)
97Dim [nothing] = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
98Dim intZero = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Create(0I), m13p(c))
99Dim longZero = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Create(0L), m13p(d))
266Dim _nothing = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
306literal = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), zero, integralType)
333literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Null, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, convertibleType, Nothing)
364literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, type1, Nothing)
622New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing),
746Dim 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)
1116Dim _nothing = New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.Nothing, Nothing)
1183New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.Null, Nothing),
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (42)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (32)
106Dim declaratorQ = tree.GetRoot().FindToken(posQ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
113Dim declaratorX = tree.GetRoot().FindToken(posX).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
120Dim declaratorZ = tree.GetRoot().FindToken(posZ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
242Dim declaratorW = tree.GetRoot().FindToken(posW).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
247Dim declaratorZF = tree.GetRoot().FindToken(posZF).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
249tree.GetRoot().FindToken(select1).GetLocation,
252tree.GetRoot().FindToken(x2 - 2).GetLocation(),
253tree.GetRoot().FindToken(y4 - 2).GetLocation())
257Dim declaratorZL = tree.GetRoot().FindToken(posZL).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
259tree.GetRoot().FindToken(select2).GetLocation,
262tree.GetRoot().FindToken(x5 - 2).GetLocation(),
263tree.GetRoot().FindToken(y5 - 2).GetLocation())
313Dim declaratorT = tree.GetRoot().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
318Dim declaratorA = tree.GetRoot().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
320tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation,
323tree.GetRoot().FindToken(x1 - 2).GetLocation(),
324tree.GetRoot().FindToken(y1 - 2).GetLocation())
328Dim declaratorB = tree.GetRoot().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
330tree.GetRoot().FindToken(sub4).Parent.Parent.GetLocation,
333tree.GetRoot().FindToken(x2 - 2).GetLocation(),
334tree.GetRoot().FindToken(y2 - 2).GetLocation())
380Dim declaratorT = tree.GetRoot().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
385Dim declaratorA = tree.GetRoot().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
387tree.GetRoot().FindToken(sub1).Parent.Parent.GetLocation,
390tree.GetRoot().FindToken(x1 - 2).GetLocation(),
391tree.GetRoot().FindToken(y1 - 2).GetLocation())
395Dim declaratorB = tree.GetRoot().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)()
398tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation,
401tree.GetRoot().FindToken(x2 - 2).GetLocation(),
402tree.GetRoot().FindToken(y2 - 2).GetLocation())
1979stack.Push(tree.GetRoot())
2055Dim x = tree.GetRoot().DescendantNodes().OfType(Of IdentifierNameSyntax)().Where(Function(n) n.Identifier.ValueText = "x").Single()
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (125)
IncrementalParser\IncrementalParser.vb (23)
82root = tree.GetRoot()
93root = tree.GetRoot()
105Assert.Equal(False, tree.GetRoot().ContainsDiagnostics)
707Dim exp1 = newTree.GetRoot().ChildNodesAndTokens()(0).ChildNodesAndTokens()(1)
708Dim inc1 = incTree.GetRoot().ChildNodesAndTokens()(0).ChildNodesAndTokens()(1)
745Assert.Equal(False, oldTree.GetRoot().ContainsDiagnostics)
746Assert.Equal(False, newTree.GetRoot().ContainsDiagnostics)
747Assert.Equal(False, incTree.GetRoot().ContainsDiagnostics)
771Assert.Equal(False, expectedTree.GetRoot().ContainsDiagnostics)
772Assert.Equal(False, incrementalTree.GetRoot().ContainsDiagnostics)
796Assert.Equal(True, expectedTree.GetRoot().ContainsDiagnostics)
797Assert.Equal(True, incrementalTree.GetRoot().ContainsDiagnostics)
1126Dim children1 = newTree.GetRoot().ChildNodesAndTokens()
1127Dim children2 = fulltree.GetRoot().ChildNodesAndTokens()
1143Assert.Equal(fullTree.GetRoot().ToFullString(), newTree.GetRoot().ToFullString())
1170Assert.Equal(fulltree.GetRoot().ToFullString(), newTree.GetRoot().ToFullString())
1186Assert.Equal(fullTree.GetRoot().ToFullString(), newTree.GetRoot().ToFullString())
1708Dim tempRoot2 = tempTree2.GetRoot()
2574Dim rootA = treeA.GetRoot()
2575Dim rootB = treeB.GetRoot()
Syntax\SyntaxAnnotationTests.vb (33)
38Dim fromNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot()
46Dim fromNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot()
47Dim toNode = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot()
56Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First()
63Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First()
71Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First()
72Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First()
82Dim toTrivia = GetAllTrivia(tree.GetRoot()).FirstOrDefault()
91Dim fromTrivia = GetAllTrivia(tree.GetRoot()).FirstOrDefault()
99Dim fromTrivia = GetAllTrivia(tree.GetRoot()).FirstOrDefault()
100Dim toTrivia = GetAllTrivia(tree.GetRoot()).FirstOrDefault()
115Dim matchingNodesOrTokens = tree.GetRoot().GetAnnotatedNodesAndTokens(annotation)
124Dim matchingTrivia = tree.GetRoot().GetAnnotatedTrivia(annotation)
139Dim node = GetAllNodesAndTokens(tree.GetRoot()).First(Function(t) t.IsNode).AsNode()
143Dim newRoot = tree.GetRoot().ReplaceNode(node, annotatedNode)
170Dim token = GetAllNodesAndTokens(tree.GetRoot()).First(Function(t) t.IsToken).AsToken()
174Dim newRoot = tree.GetRoot().ReplaceToken(token, annotatedToken)
201Dim trivia = GetAllTrivia(tree.GetRoot()).First()
205Dim newRoot = tree.GetRoot().ReplaceTrivia(trivia, annotatedTrivia)
228Dim newRoot = tree.GetRoot()
241TestMultipleAnnotationsInTree(tree.GetRoot(), newRoot, annotations)
258Dim firstNode = GetAllNodesAndTokens(tree.GetRoot()).First(Function(t) t.IsNode).AsNode()
263Dim newRoot = tree.GetRoot().ReplaceNode(lastChildOfFirstNode, annotatedNode)
353Dim sourceTreeRoot = DirectCast(rewriter.Visit(tree1.GetRoot()), VisualBasicSyntaxNode)
355Dim destTreeRoot = CopyAnnotationsTo(sourceTreeRoot, tree2.GetRoot())
430Dim currentRoot = tree.GetRoot()
459Dim candidatePool = GetAllNodesAndTokens(tree.GetRoot())
469Dim newRoot = Replace(tree.GetRoot(), firstItem, firstAnnotated)
511For Each trivia In GetAllTrivia(tree.GetRoot())
514Dim newRoot = tree.GetRoot().ReplaceTrivia(trivia, newTrivia)
523For Each nodeOrToken In GetAllNodesAndTokens(tree.GetRoot())
529newRoot = tree.GetRoot().ReplaceToken(nodeOrToken.AsToken(), newToken)
532newRoot = tree.GetRoot().ReplaceNode(nodeOrToken.AsNode(), newNode)
TestSyntaxNodes.vb (21)
1735Dim node As SyntaxNode = tree.GetRoot()
1737Assert.Equal(0, tree.GetRoot().FindToken(node.FullSpan.Length - 1).TrailingTrivia.Count)
1738Assert.Equal(1, tree.GetRoot().FindToken(0).LeadingTrivia.Count)
1765Dim node As SyntaxNode = tree.GetRoot()
1986Dim openParenToken = CType(tree.GetRoot().FindToken(location + "List".Length), SyntaxToken)
2215Dim tokens As List(Of SyntaxToken) = tree.GetRoot().DescendantTokens().ToList()
2217Dim token As SyntaxToken = tree.GetRoot().GetFirstToken()
2232token = tree.GetRoot().GetFirstToken()
2239Dim lastToken = tree.GetRoot().DescendantTokens().Last
2256Dim root = tree.GetRoot()
2353Dim trivia = tree.GetRoot().FindTrivia(position)
2868Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
2914Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
2959For Each node In tree.GetRoot.ChildNodes
3294Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
3368Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
3394Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
3418Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
3439Dim trivia = tree.GetRoot().FindTrivia(4000)
3462Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
3481Dim Root As CompilationUnitSyntax = CType(tree.GetRoot(), CompilationUnitSyntax)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (21)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (16)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (7)
Microsoft.CodeAnalysis.Workspaces (35)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.UnitTests (57)
SolutionTests\SolutionTests.cs (24)
305var root = tree.GetRoot();
1799Assert.False(oldTree.GetRoot().IsIncrementallyIdenticalTo(newTree.GetRoot()));
1832var oldRoot = oldTree.GetRoot();
1846Assert.Equal(expectReuse, oldRoot.IsIncrementallyIdenticalTo(newTree.GetRoot()));
1869Assert.False(oldTree.GetRoot().IsIncrementallyIdenticalTo(newTree.GetRoot()));
1888Assert.False(oldTree.GetRoot().IsIncrementallyIdenticalTo(newTree.GetRoot()));
1907Assert.True(oldTree.GetRoot().IsIncrementallyIdenticalTo(newTree.GetRoot()));
2507var root = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From("class C {}", encoding: Encoding.ASCII, SourceHashAlgorithm.Sha1)).GetRoot();
3217var root = tree.GetRoot();
3225var root2 = tree2.GetRoot();
3431Assert.Equal(text, docTree.GetRoot().ToString());
3452Assert.Equal(text, docTree.GetRoot().ToString());
3461var tree = CSharp.SyntaxFactory.ParseSyntaxTree("public class C {}").GetRoot(CancellationToken.None);
3720var root = tree.GetRoot();
3737var root2 = tree2.GetRoot();
3816Assert.Same(tree2, tree2.GetRoot().SyntaxTree);
3844Assert.Same(tree3, tree3.GetRoot().SyntaxTree);
3851var tree4 = tree.WithRootAndOptions(tree.GetRoot(), newOptions);
3855Assert.Same(tree4, tree4.GetRoot().SyntaxTree);
3862Assert.Same(tree, tree.WithRootAndOptions(tree.GetRoot(), tree.Options));
Microsoft.DotNet.GenFacades (1)
Microsoft.Extensions.Validation.GeneratorTests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.ML.CodeGenerator (1)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.VisualStudio.LanguageServices (2)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Mvc.Api.Analyzers.Test (4)
Roslyn.Diagnostics.Analyzers (25)
Roslyn.Diagnostics.CSharp.Analyzers (18)
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
Test.Utilities (21)
Text.Analyzers (23)