1156 references to SyntaxTree
ConfigurationSchemaGenerator (1)
GenerateDocumentationAndConfigFiles (32)
Metrics (16)
Metrics.Legacy (16)
Microsoft.Analyzers.Extra (2)
Microsoft.AspNetCore.App.Analyzers (3)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (5)
Microsoft.CodeAnalysis (34)
DiagnosticAnalyzer\AnalysisContextInfo.cs (3)
43this(compilation: compilation, operation: null, symbol: null, file: new SourceOrAdditionalFile(node.SyntaxTree), node)
48this(compilation: compilation, operation: operation, symbol: null, file: new SourceOrAdditionalFile(operation.Syntax.SyntaxTree), node: operation.Syntax)
53this(compilation: compilation, operation: null, symbol: symbol, file: new SourceOrAdditionalFile(node.SyntaxTree), node)
DiagnosticAnalyzer\AnalyzerExecutor.cs (6)
677Debug.Assert(!IsAnalyzerSuppressedForTree(syntaxNodeAction.Analyzer, node.SyntaxTree, cancellationToken));
865@this.GetControlFlowGraph, declaredNode.SyntaxTree, executionData.FilterSpan, executionData.IsGeneratedCode, cancellationToken);
895@this.AnalyzerOptions, diagReporter.AddDiagnosticAction, isSupportedDiagnostic, @this.GetControlFlowGraph, declaredNode.SyntaxTree,
934IsAnalyzerSuppressedForTree(executionData.Analyzer, declaredNode.SyntaxTree, cancellationToken))
1515_isGeneratedCodeLocation(node.SyntaxTree, node.Span, cancellationToken))
1527_isGeneratedCodeLocation(operation.Syntax.SyntaxTree, operation.Syntax.Span, cancellationToken))
Microsoft.CodeAnalysis.Analyzers (41)
Microsoft.CodeAnalysis.AnalyzerUtilities (21)
Microsoft.CodeAnalysis.BannedApiAnalyzers (34)
Microsoft.CodeAnalysis.CodeStyle (42)
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
Microsoft.CodeAnalysis.CSharp (38)
Microsoft.CodeAnalysis.CSharp.CodeStyle (36)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
70root.SyntaxTree,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (15)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (52)
Semantics\PrimaryConstructorTests.cs (11)
2187var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx");
2188var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray();
3803Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
3829Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
3847Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
3878Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
3905Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree);
5292Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
5310Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
5328Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
5357Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Features (65)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
70root.SyntaxTree,
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (23)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (77)
Syntax\SyntaxFactoryTests.cs (11)
53var text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText();
688Assert.Same(parseOptions, argList.SyntaxTree.Options);
691Assert.Same(parseOptions, attrArgList.SyntaxTree.Options);
694Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options);
697Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options);
700Assert.Same(parseOptions, compUnit.SyntaxTree.Options);
703Assert.Same(parseOptions, expr.SyntaxTree.Options);
706Assert.Same(parseOptions, memberDecl.SyntaxTree.Options);
709Assert.Same(parseOptions, paramList.SyntaxTree.Options);
712Assert.Same(parseOptions, statement.SyntaxTree.Options);
715Assert.Same(parseOptions, typeName.SyntaxTree.Options);
Syntax\SyntaxRewriterTests.cs (43)
315Assert.NotNull(node.SyntaxTree);
316Assert.False(node.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?");
317Assert.Same(node, node.SyntaxTree.GetRoot());
324Assert.NotNull(node1.SyntaxTree);
325Assert.True(node1.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?");
326Assert.Same(node1, node1.SyntaxTree.GetRoot());
328Assert.NotNull(node2.SyntaxTree);
329Assert.False(node2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?");
330Assert.Same(node2, node2.SyntaxTree.GetRoot());
338Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceToken(tokenT, tokenT).SyntaxTree);
340Assert.NotNull(newRoot.SyntaxTree);
341Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?");
342Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot());
350Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceNode(typeName, typeName).SyntaxTree);
352Assert.NotNull(newRoot.SyntaxTree);
353Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?");
354Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot());
367var newTree = newRoot.SyntaxTree;
386var newTree = newRoot.SyntaxTree;
406var newTree = newNode.SyntaxTree;
413var newTree2 = newNode2.SyntaxTree;
433var newTree = newRoot.SyntaxTree;
450var newTree = newRoot.SyntaxTree;
456var newTree2 = newRoot2.SyntaxTree;
477var newTree = newRoot.SyntaxTree;
483var newTree2 = newRoot2.SyntaxTree;
505var newTree = newRoot.SyntaxTree;
518var newTree = newRoot.SyntaxTree;
531var newTree = newRoot.SyntaxTree;
540Assert.NotNull(tree.GetCompilationUnitRoot().SyntaxTree);
543Assert.NotNull(rewrittenRoot.SyntaxTree);
544Assert.True(rewrittenRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?");
545Assert.Same(rewrittenRoot, rewrittenRoot.SyntaxTree.GetRoot());
558Assert.NotNull(expr1.SyntaxTree);
559Assert.False(expr1.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?");
560Assert.Same(ifStmt1, expr1.SyntaxTree.GetRoot());
576Assert.NotNull(expr2.SyntaxTree);
577Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?");
578Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot());
606Assert.Equal(tree1, expr1.SyntaxTree);
622Assert.NotNull(expr2.SyntaxTree);
623Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?");
624Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (17)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeGeneration\CodeGenerationTests.cs (5)
92var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, root.SyntaxTree.Options);
316var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, oldSyntax.SyntaxTree.Options);
331var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, oldMemberSyntax.SyntaxTree.Options);
557var info = codeGenerator.GetInfo(CodeGenerationContext.Default, options, oldNode.SyntaxTree.Options);
598var info = codeGenerator.GetInfo(new CodeGenerationContext(reuseSyntax: true), options, declarationNode.SyntaxTree.Options);
Microsoft.CodeAnalysis.Features (90)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (24)
550var oldTree = oldRoot.SyntaxTree;
551var newTree = newRoot.SyntaxTree;
758oldRoot ??= GetEmptyRoot(newRoot!.SyntaxTree.Options);
759newRoot ??= GetEmptyRoot(oldRoot.SyntaxTree.Options);
765=> EmptyCompilationUnit.SyntaxTree.WithRootAndOptions(EmptyCompilationUnit, options).GetRoot(cancellationToken);
915newExceptionRegions[i] = GetExceptionRegions(ancestors, newStatement.SyntaxTree, cancellationToken).Spans;
1059newActiveStatements[activeStatementIndex] = GetActiveStatementWithSpan(oldActiveStatements[activeStatementIndex], topMatch.NewRoot.SyntaxTree, newSpan, diagnostics, cancellationToken);
1446newExceptionRegions[ordinal] = GetExceptionRegions(newAncestors, newStatementSyntax.SyntaxTree, cancellationToken).Spans;
1639return GetExceptionRegions(ancestors, root.SyntaxTree, cancellationToken);
2103var oldTree = topMatch.OldRoot.SyntaxTree;
2104var newTree = topMatch.NewRoot.SyntaxTree;
2591var oldTree = editScript.Match.OldRoot.SyntaxTree;
2592var newTree = editScript.Match.NewRoot.SyntaxTree;
2627var newTypeDeclaration = GetSymbolDeclarationSyntax(newSymbol, refs => refs.First(r => r.SyntaxTree == edit.NewNode!.SyntaxTree), cancellationToken);
2664if (oldSymbol == null || oldDeclaration == null || oldDeclaration != null && oldDeclaration.SyntaxTree != oldModel.SyntaxTree)
2668else if (newSymbol == null || newDeclaration == null || newDeclaration != null && newDeclaration.SyntaxTree != newModel.SyntaxTree)
3210? new(await oldProject.Solution.GetRequiredDocument(oldDeclaration.SyntaxTree).GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false))
4966var oldContainerDeclaration = analyzer.GetSymbolDeclarationSyntax(oldSymbol.ContainingSymbol, topMatch.OldRoot.SyntaxTree, cancellationToken);
5037span: (locationNode.SyntaxTree == newModel.SyntaxTree) ?
5334var oldSyntaxTree = topMatch.OldRoot.SyntaxTree;
5335var newSyntaxTree = topMatch.NewRoot.SyntaxTree;
5452if (newDeclaration?.SyntaxTree == newSyntaxTree)
6600Debug.Assert(otherNode.SyntaxTree == otherRoot.SyntaxTree);
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (34)
Microsoft.CodeAnalysis.PublicApiAnalyzers (16)
Microsoft.CodeAnalysis.ResxSourceGenerator (16)
Microsoft.CodeAnalysis.Test.Utilities (12)
Diagnostics\CommonDiagnosticAnalyzers.cs (8)
2758ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax}) in RegisterSymbolStartAction", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic),
2762ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node}) in RegisterSymbolStartAction", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic),
2772ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax})", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic),
2785ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax}) in RegisterOperationBlockStartAction", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic),
2795ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node})", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic),
2801ReportDiagnostics("RegisterCodeBlockAction", codeBlockContext.CodeBlock.SyntaxTree, codeBlockContext.OwningSymbol, codeBlockContext.ReportDiagnostic));
2808ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node}) in RegisterCodeBlockStartAction", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic),
2812ReportDiagnostics("RegisterCodeBlockEndAction", codeBlockEndContext.CodeBlock.SyntaxTree, codeBlockEndContext.OwningSymbol, codeBlockEndContext.ReportDiagnostic));
Microsoft.CodeAnalysis.VisualBasic (36)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (5)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Features (10)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (9)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (18)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (3)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (11)
Microsoft.CodeAnalysis.Workspaces (52)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.Validation.ValidationsGenerator (1)
Microsoft.Gen.ComplianceReports (2)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.Logging (1)
Microsoft.Gen.MetadataExtractor (4)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.MetricsReports (2)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.VisualStudio.LanguageServices (3)
Microsoft.VisualStudio.LanguageServices.CSharp (30)
CodeModel\CSharpCodeModelService.NodeLocator.cs (27)
239return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
272return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
302return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
350return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
429return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
504return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
553return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
602return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
642return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
675return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
716return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
756return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
796return new VirtualTreePoint(node.SyntaxTree, text, startPosition);
814return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
847return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
877return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
918return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
992return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1052return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1091return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1132return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1170return new VirtualTreePoint(fileScopedNamespace.SyntaxTree, text, fileScopedNamespace.Parent.Span.End);
1181return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1214return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1255return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1297return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
1338return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
Microsoft.VisualStudio.LanguageServices.VisualBasic (42)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (39)
248Return New VirtualTreePoint(attributes.First().SyntaxTree, text, startPosition)
280Return New VirtualTreePoint(attributes.Last().SyntaxTree, text, startPosition)
356Return New VirtualTreePoint(typeBlock.SyntaxTree, text, startPosition)
382Return New VirtualTreePoint(typeBlock.SyntaxTree, text, startPosition)
427Return New VirtualTreePoint(enumBlock.SyntaxTree, text, startPosition)
453Return New VirtualTreePoint(enumBlock.SyntaxTree, text, startPosition)
512Return New VirtualTreePoint(methodBlock.SyntaxTree, text, startPosition)
548Return New VirtualTreePoint(declareStatement.SyntaxTree, text, startPosition)
577Return New VirtualTreePoint(declareStatement.SyntaxTree, text, endPosition)
613Return New VirtualTreePoint(methodStatement.SyntaxTree, text, startPosition)
668Return New VirtualTreePoint(methodBlock.SyntaxTree, text, startPosition)
697Return New VirtualTreePoint(methodStatement.SyntaxTree, text, endPosition)
736Return New VirtualTreePoint(propertyStatement.SyntaxTree, text, startPosition)
781Return New VirtualTreePoint(propertyStatement.SyntaxTree, text, startPosition)
821Return New VirtualTreePoint(eventBlock.SyntaxTree, text, startPosition)
858Return New VirtualTreePoint(eventStatement.SyntaxTree, text, startPosition)
903Return New VirtualTreePoint(eventStatement.SyntaxTree, text, startPosition)
939Return New VirtualTreePoint(delegateStatement.SyntaxTree, text, startPosition)
968Return New VirtualTreePoint(delegateStatement.SyntaxTree, text, endPosition)
1034Return New VirtualTreePoint(namespaceBlock.SyntaxTree, text, startPosition)
1065Return New VirtualTreePoint(namespaceBlock.SyntaxTree, text, endPosition)
1097Return New VirtualTreePoint(variable.SyntaxTree, text, startPosition)
1122Return New VirtualTreePoint(enumMember.SyntaxTree, text, startPosition)
1149Return New VirtualTreePoint(variable.SyntaxTree, text, endPosition)
1173Return New VirtualTreePoint(enumMember.SyntaxTree, text, endPosition)
1203Return New VirtualTreePoint(parameter.SyntaxTree, text, startPosition)
1227Return New VirtualTreePoint(parameter.SyntaxTree, text, endPosition)
1253Return New VirtualTreePoint(importsStatement.SyntaxTree, text, startPosition)
1279Return New VirtualTreePoint(importsStatement.SyntaxTree, text, endPosition)
1305Return New VirtualTreePoint(optionStatement.SyntaxTree, text, startPosition)
1331Return New VirtualTreePoint(optionStatement.SyntaxTree, text, endPosition)
1357Return New VirtualTreePoint(inheritsStatement.SyntaxTree, text, startPosition)
1383Return New VirtualTreePoint(inheritsStatement.SyntaxTree, text, endPosition)
1409Return New VirtualTreePoint(implementsStatement.SyntaxTree, text, startPosition)
1435Return New VirtualTreePoint(implementsStatement.SyntaxTree, text, endPosition)
1464Return New VirtualTreePoint(attribute.SyntaxTree, text, startPosition)
1492Return New VirtualTreePoint(attribute.SyntaxTree, text, endPosition)
1527Return New VirtualTreePoint(argument.SyntaxTree, text, startPosition)
1561Return New VirtualTreePoint(argument.SyntaxTree, text, endPosition)
Roslyn.Diagnostics.Analyzers (35)
Roslyn.Diagnostics.CSharp.Analyzers (11)
Roslyn.Diagnostics.VisualBasic.Analyzers (3)
System.Private.CoreLib.Generators (2)
System.Text.RegularExpressions.Generator (2)
System.Windows.Forms.PrivateSourceGenerators (1)
Test.Utilities (14)
Text.Analyzers (34)