67 references to Tree
Microsoft.CodeAnalysis (2)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
34var semanticModel = _compilation.GetSemanticModel(context.Tree);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (1)
1365/// Indicates if the <see cref="Tree"/> is generated code.
Microsoft.CodeAnalysis.CodeStyle (8)
AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
39ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.GetRoot(context.CancellationToken));
AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
46var root = context.Tree.GetRoot(cancellationToken);
AbstractFileHeaderDiagnosticAnalyzer.cs (1)
43var tree = context.Tree;
AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
42var root = context.Tree.GetRoot(cancellationToken);
AbstractOrderModifiersDiagnosticAnalyzer.cs (2)
49var root = context.Tree.GetRoot(context.CancellationToken); 73Diagnostic.Create(Descriptor, context.Tree.GetLocation(
AnalyzerOptionsProvider.cs (1)
139=> GetAnalyzerOptions(context.Options, context.Tree);
FormattingAnalyzerHelper.cs (1)
20var tree = context.Tree;
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
39Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
40Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (2)
41Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken)); 65var sourceText = context.Tree.GetText(context.CancellationToken);
CSharpAnalyzerOptionsProvider.cs (1)
141=> GetCSharpAnalyzerOptions(context.Options, context.Tree);
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
49var root = context.Tree.GetCompilationUnitRoot(context.CancellationToken); 50var initialState = context.Tree.IsGeneratedCode(context.Options, CSharpSyntaxFacts.Instance, context.CancellationToken)
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
40Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
237=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.GetRoot().GetFirstToken().GetLocation())); 356=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.Create(context.Tree, TextSpan.FromBounds(1000, 2000))));
Microsoft.CodeAnalysis.CSharp.Features (9)
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
39Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
40Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (2)
41Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken)); 65var sourceText = context.Tree.GetText(context.CancellationToken);
CSharpAnalyzerOptionsProvider.cs (1)
141=> GetCSharpAnalyzerOptions(context.Options, context.Tree);
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
49var root = context.Tree.GetCompilationUnitRoot(context.CancellationToken); 50var initialState = context.Tree.IsGeneratedCode(context.Options, CSharpSyntaxFacts.Instance, context.CancellationToken)
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
40Recurse(context, option.Notification.Severity, context.Tree.GetRoot(context.CancellationToken));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\CodeFixServiceTests.cs (1)
508c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Diagnostics\DiagnosticAnalyzerServiceTests.cs (3)
1253context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 1269context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 1282=> context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation())));
Diagnostics\DiagnosticsClassificationTaggerProviderTests.cs (4)
94var primaryLocation = Location.Create(c.Tree, new TextSpan(0, 10)); 105var additionalLocations = ImmutableArray.Create(Location.Create(c.Tree, new TextSpan(0, 10))); 107Location.Create(c.Tree, new TextSpan(0, 1)), 108Location.Create(c.Tree, new TextSpan(9, 1)));
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (1)
229c.ReportDiagnostic(Diagnostic.Create(_rule, Location.Create(c.Tree, new TextSpan(0, 1))));
Microsoft.CodeAnalysis.Features (8)
AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
39ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.GetRoot(context.CancellationToken));
AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
46var root = context.Tree.GetRoot(cancellationToken);
AbstractFileHeaderDiagnosticAnalyzer.cs (1)
43var tree = context.Tree;
AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
42var root = context.Tree.GetRoot(cancellationToken);
AbstractOrderModifiersDiagnosticAnalyzer.cs (2)
49var root = context.Tree.GetRoot(context.CancellationToken); 73Diagnostic.Create(Descriptor, context.Tree.GetLocation(
AnalyzerOptionsProvider.cs (1)
139=> GetAnalyzerOptions(context.Options, context.Tree);
FormattingAnalyzerHelper.cs (1)
20var tree = context.Tree;
Microsoft.CodeAnalysis.Test.Utilities (14)
Diagnostics\CommonDiagnosticAnalyzers.cs (12)
70var location = context.Tree.GetRoot().GetLocation(); 818c.ReportDiagnostic(Diagnostic.Create(Descriptor, SourceLocation.Create(c.Tree, _badSpan))); 1432sortedCallbackTreePaths.Add($"{treeContext.Tree.FilePath}(IsGeneratedCode:{treeContext.IsGeneratedCode})"); 1433ReportTreeDiagnostics(treeContext.Tree, treeContext.ReportDiagnostic); 1710context.TryGetValue(treeContext.Tree, _treeValueProvider, out var isGeneratedCode); 1713var diagnostic = Diagnostic.Create(descriptor, Location.None, treeContext.Tree.FilePath); 1716context.TryGetValue(treeContext.Tree.GetText(), _textValueProvider, out var length); 1717diagnostic = Diagnostic.Create(UniqueTextFileDescriptor, Location.None, treeContext.Tree.FilePath); 2429var fields = context.Tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.FieldDeclarationSyntax>(); 2526context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.GetRoot().GetLocation())); 2608context.RegisterSyntaxTreeAction(syntaxContext => HandleCallback(syntaxContext.Tree.GetRoot().GetLocation(), context.Compilation, syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken)); 2696context.RegisterSyntaxTreeAction(treeContext => AnalyzedTrees.Add(treeContext.Tree));
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (2)
205var comments = context.Tree.GetRoot().DescendantTrivia() 244foreach (var nodeOrToken in context.Tree.GetRoot().DescendantNodesAndTokens())
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
81c.RegisterSyntaxTreeAction(b => ThrowIfMatch(nameof(c.RegisterSyntaxTreeAction), new AnalysisContextInfo(b.Compilation, new SourceOrAdditionalFile(b.Tree))));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
VisualBasicAnalyzerOptionsProvider.vb (1)
112Return GetVisualBasicAnalyzerOptions(context.Options, context.Tree)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
VisualBasicAnalyzerOptionsProvider.vb (1)
112Return GetVisualBasicAnalyzerOptions(context.Options, context.Tree)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
111c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Roslyn.VisualStudio.Next.UnitTests (2)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
295c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1)))); 313c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1))));