50 references to Tree
Microsoft.CodeAnalysis (4)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
34var semanticModel = _compilation.GetSemanticModel(context.Tree);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (3)
1527/// Optional filter span within the <see cref="Tree"/> for which to compute diagnostics. 1528/// <see langword="null"/> if we are analyzing the entire <see cref="Tree"/> 1534/// Indicates if the <see cref="Tree"/> is generated code.
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
97=> ShouldSkipAnalysis(context.Tree, context.Options, compilationOptions, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
43ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.GetRoot(context.CancellationToken));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (1)
151=> context.Tree.FindNode(context.FilterSpan, findInTrivia, getInnermostNodeForTie, context.CancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
69var sourceText = context.Tree.GetText(context.CancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
61NullableContextOptions? currentState = context.Tree.IsGeneratedCode(context.Options, CSharpSyntaxFacts.Instance, context.CancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
236=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.GetRoot().GetFirstToken().GetLocation())); 355=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.Create(context.Tree, TextSpan.FromBounds(1000, 2000))));
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
69var sourceText = context.Tree.GetText(context.CancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
61NullableContextOptions? currentState = context.Tree.IsGeneratedCode(context.Options, CSharpSyntaxFacts.Instance, context.CancellationToken)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (1)
563c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
923context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 939context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation())));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
2521context.RegisterSyntaxTreeAction(Sub(treeContext) AnalyzedTrees.Add(treeContext.Tree))
Microsoft.CodeAnalysis.Features (5)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
97=> ShouldSkipAnalysis(context.Tree, context.Options, compilationOptions, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
43ProcessCompilationUnit(context, option, (TCompilationUnitSyntax)context.Tree.GetRoot(context.CancellationToken));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\NonLocalDiagnosticTests.cs (1)
91if (tree != context.Tree)
Diagnostics\PullDiagnosticTests.cs (1)
137context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Tree.GetRoot(context.CancellationToken).GetLocation())));
Microsoft.CodeAnalysis.Test.Utilities (16)
Diagnostics\CommonDiagnosticAnalyzers.cs (14)
71var location = context.Tree.GetRoot().GetLocation(); 904c.ReportDiagnostic(Diagnostic.Create(Descriptor, SourceLocation.Create(c.Tree, _badSpan))); 1542sortedCallbackTreePaths.Add($"{treeContext.Tree.FilePath}(IsGeneratedCode:{treeContext.IsGeneratedCode})"); 1543ReportTreeDiagnostics(treeContext.Tree, treeContext.ReportDiagnostic); 1820context.TryGetValue(treeContext.Tree, _treeValueProvider, out var isGeneratedCode); 1823var diagnostic = Diagnostic.Create(descriptor, Location.None, treeContext.Tree.FilePath); 1826context.TryGetValue(treeContext.Tree.GetText(), _textValueProvider, out var length); 1827diagnostic = Diagnostic.Create(UniqueTextFileDescriptor, Location.None, treeContext.Tree.FilePath); 2600var fields = context.Tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.FieldDeclarationSyntax>(); 2697context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.GetRoot().GetLocation())); 2740ReportDiagnosticsInAllTrees("RegisterSyntaxTreeAction", treeContext.Tree, treeContext.Compilation, treeContext.ReportDiagnostic)); 2934context.RegisterSyntaxTreeAction(syntaxContext => HandleCallback(syntaxContext.Tree.GetRoot().GetLocation(), context.Compilation, syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken)); 3022context.RegisterSyntaxTreeAction(treeContext => AnalyzedTrees.Add(treeContext.Tree)); 3106CallbackFilterTree = context.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.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (1)
151=> context.Tree.FindNode(context.FilterSpan, findInTrivia, getInnermostNodeForTie, context.CancellationToken);
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)
276c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1)))); 294c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1))));