2 types derived from SyntaxTree
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpSyntaxTree.cs (1)
26public abstract partial class CSharpSyntaxTree : SyntaxTree
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxTree.vb (1)
23Inherits SyntaxTree
2882 references to SyntaxTree
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
179SyntaxTree operationSyntaxTree = invocation.Syntax.SyntaxTree;
ConfigurationSchemaGenerator.Tests (3)
GeneratorTests.cs (3)
30private static readonly SyntaxTree s_implicitUsingsSyntaxTree = SyntaxFactory.ParseSyntaxTree(SourceText.From( 42private static readonly SyntaxTree s_attributesSyntaxTree = CSharpSyntaxTree.ParseText(File.ReadAllText("ConfigurationSchemaAttributes.cs")); 1561var sourceSyntaxTree = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceText));
dotnet-format (8)
Analyzers\AnalyzerOptionExtensions.cs (4)
32SyntaxTree tree, 96public static bool IsDiagnosticSeverityConfigured(this AnalyzerConfigOptions analyzerConfigOptions, Project project, SyntaxTree tree, string diagnosticId, string? diagnosticCategory) 107public static DiagnosticSeverity GetDiagnosticSeverity(this AnalyzerConfigOptions analyzerConfigOptions, Project project, SyntaxTree tree, string diagnosticId, string? diagnosticCategory) 125SyntaxTree tree,
Analyzers\Extensions.cs (1)
85if (!document.TryGetSyntaxTree(out var tree))
CodeFormatter.cs (1)
223var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Formatters\DocumentFormatter.cs (1)
81var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Utilities\GeneratedCodeUtilities.cs (1)
22internal static async Task<bool> IsGeneratedCodeAsync(SyntaxTree syntaxTree, CancellationToken cancellationToken)
GenerateDocumentationAndConfigFiles (122)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
199foreach (var tree in compilation.SyntaxTrees)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
31public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 48public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (9)
31ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 34private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 36private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions) 67var perTreeOptionsBuilder = PooledDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance(); 68foreach (var tree in compilation.SyntaxTrees) 75static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider) 82public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 100public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 110private bool TryGetOptionValue<T, TArg>(string optionName, OptionKind kind, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, [MaybeNullWhen(false)] out T value)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (30)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 51=> TryGetSyntaxTreeForOption(symbol, out var tree) 58SyntaxTree tree, 69=> TryGetSyntaxTreeForOption(symbol, out var tree) 76SyntaxTree tree, 87=> TryGetSyntaxTreeForOption(symbol, out var tree) 94SyntaxTree tree, 102SyntaxTree tree, 109SyntaxTree tree, 120=> TryGetSyntaxTreeForOption(symbol, out var tree) 127SyntaxTree tree, 136SyntaxTree tree, 152SyntaxTree tree, 179SyntaxTree tree, 192=> TryGetSyntaxTreeForOption(symbol, out var tree) 200SyntaxTree tree, 212SyntaxTree tree, 224SyntaxTree tree, 240SyntaxTree tree, 247SyntaxTree tree, 300=> TryGetSyntaxTreeForOption(symbol, out var tree) 309=> TryGetSyntaxTreeForOption(symbol, out var tree) 324SyntaxTree? tree, 338SyntaxTree? tree, 387SyntaxTree? tree, 426SyntaxTree tree, 434SyntaxTree tree, 441SyntaxTree tree, 448SyntaxTree tree, 456SyntaxTree? tree,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\ICategorizedAnalyzerConfigOptions.cs (2)
51T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality); 53T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
241var destinationTree = destinationDeclaration.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
78var syntaxTree = destination.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
50public SyntaxTree SyntaxTree { get; } = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 59if (document.TryGetSyntaxTree(out var syntaxTree)) 239var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
26var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
15bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 18Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
51var previousSyntaxTree = previousSemanticModel.SyntaxTree; 52var currentSyntaxTree = currentBodyNode.SyntaxTree; 178private readonly SyntaxTree _originalSyntaxTree; 179private readonly SyntaxTree _updatedSyntaxTree; 182public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Infrastructure.Tests (1)
ExtractTestPartitions\MockAssemblyBuilder.cs (1)
232var syntaxTree = CSharpSyntaxTree.ParseText(code);
Microsoft.Analyzers.Extra.Tests (4)
SyntaxNodeExtensionsTests.cs (4)
47SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 79SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 142SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 173SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr);
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
30var syntaxTree = semanticModel.SyntaxTree;
Microsoft.CodeAnalysis (320)
CodeGen\ILBuilder.cs (4)
37private SyntaxTree? _lastSeqPointTree; 1029internal void DefineSequencePoint(SyntaxTree syntaxTree, TextSpan span) 1069var lastDebugDocument = _lastSeqPointTree; 1098internal void SetInitialDebugDocument(SyntaxTree initialSequencePointTree)
CodeGen\RawSequencePoint.cs (2)
16internal readonly SyntaxTree SyntaxTree; 23internal RawSequencePoint(SyntaxTree syntaxTree, int ilMarker, TextSpan span)
CodeGen\SequencePointList.cs (3)
23private readonly SyntaxTree _tree; 37private SequencePointList(SyntaxTree tree, OffsetAndSpan[] points) 130SyntaxTree currentTree = current._tree;
CommandLine\AnalyzerConfigSet.cs (1)
298treeOptionsBuilder.Count > 0 ? treeOptionsBuilder.ToImmutable() : SyntaxTree.EmptyDiagnosticOptions,
CommandLine\CommonCompiler.cs (8)
421var embeddedTreeMap = new Dictionary<string, SyntaxTree>(Arguments.EmbeddedFiles.Length); 424foreach (var tree in compilation.SyntaxTrees) 448SyntaxTree? tree; 471SyntaxTree tree, 795/// <param name="generatedFilesBaseDirectory">The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.</param> 1022IEnumerable<SyntaxTree> syntaxTrees, 1029foreach (var syntaxTree in syntaxTrees) 1164foreach (var tree in generatedSyntaxTrees)
Compilation\CommonSyntaxAndDeclarationManager.cs (2)
11internal readonly ImmutableArray<SyntaxTree> ExternalSyntaxTrees; 18ImmutableArray<SyntaxTree> externalSyntaxTrees,
Compilation\Compilation.cs (40)
98protected static IReadOnlyDictionary<string, string> SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree> trees) 102foreach (var tree in trees) 198ImmutableArray<SyntaxTree> syntaxTrees, 335public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility = false) 342public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 347/// If <see cref="SemanticModelProvider"/> is non-null, it attempts to use <see cref="SemanticModelProvider.GetSemanticModel(SyntaxTree, Compilation, SemanticModelOptions)"/> 348/// to get a semantic model. Otherwise, it creates a new semantic model using <see cref="CreateSemanticModel(SyntaxTree, SemanticModelOptions)"/>. 351protected abstract SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options); 355/// Unlike the <see cref="GetSemanticModel(SyntaxTree, bool)"/> and <see cref="CommonGetSemanticModel(SyntaxTree, SemanticModelOptions)"/>, 359internal abstract SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options); 577public IEnumerable<SyntaxTree> SyntaxTrees { get { return CommonSyntaxTrees; } } 578protected internal abstract ImmutableArray<SyntaxTree> CommonSyntaxTrees { get; } 585public Compilation AddSyntaxTrees(params SyntaxTree[] trees) 595public Compilation AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 600protected abstract Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees); 608public Compilation RemoveSyntaxTrees(params SyntaxTree[] trees) 619public Compilation RemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 624protected abstract Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees); 644public Compilation ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree) 649protected abstract Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree); 655public bool ContainsSyntaxTree(SyntaxTree syntaxTree) 660protected abstract bool CommonContainsSyntaxTree(SyntaxTree? syntaxTree); 1095foreach (var tree in this.CommonSyntaxTrees) 2516foreach (var tree in CommonSyntaxTrees) 2552foreach (var tree in CommonSyntaxTrees) 2574foreach (var tree in CommonSyntaxTrees) 2584internal abstract void AddDebugSourceDocumentsForChecksumDirectives(DebugDocumentsBuilder documentsBuilder, SyntaxTree tree, DiagnosticBag diagnostics); 2614internal static bool ReportUnusedImportsInTree(SyntaxTree tree) 2628internal abstract void CompleteTrees(SyntaxTree? filterTree); 3666private ConcurrentDictionary<SyntaxTree, SmallConcurrentSetOfInts>? _lazyTreeToUsedImportDirectivesMap; 3667private static readonly Func<SyntaxTree, SmallConcurrentSetOfInts> s_createSetCallback = t => new SmallConcurrentSetOfInts(); 3669private ConcurrentDictionary<SyntaxTree, SmallConcurrentSetOfInts> TreeToUsedImportDirectivesMap 3682internal void MarkImportDirectiveAsUsed(SyntaxTree? syntaxTree, int position) 3692internal bool IsImportDirectiveUsed(SyntaxTree syntaxTree, int position) 3711internal int CompareSyntaxTreeOrdering(SyntaxTree tree1, SyntaxTree tree2) 3724internal abstract int GetSyntaxTreeOrdinal(SyntaxTree tree);
Compilation\DeterministicKey.cs (4)
26public static SyntaxTreeKey Create(SyntaxTree tree) 31private readonly SyntaxTree _tree; 33public DefaultSyntaxTreeKey(SyntaxTree tree) 53ImmutableArray<SyntaxTree> syntaxTrees,
Compilation\GeneratedKind.cs (3)
10/// It is unknown if the <see cref="SyntaxTree"/> is automatically generated. 14/// The <see cref="SyntaxTree"/> is not automatically generated. 18/// The <see cref="SyntaxTree"/> is marked as automatically generated.
Compilation\SemanticModel.cs (3)
18/// an instance is obtained by a call to <see cref="Compilation.GetSemanticModel(SyntaxTree, SemanticModelOptions)"/>. 60public SyntaxTree SyntaxTree 68protected abstract SyntaxTree SyntaxTreeCore { get; }
Compilation\SemanticModelProvider.cs (1)
18public abstract SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default);
Compilation\SyntaxTreeOptionsProvider.cs (8)
16public abstract GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken); 21public abstract bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancellationToken, out ReportDiagnostic severity); 45DiagnosticOptions = SyntaxTree.EmptyDiagnosticOptions; 51private readonly ImmutableDictionary<SyntaxTree, Options> _options; 56SyntaxTree?[] trees, 60var builder = ImmutableDictionary.CreateBuilder<SyntaxTree, Options>(); 74public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken _) 77public override bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken _, out ReportDiagnostic severity)
Diagnostic\Diagnostic.cs (2)
494internal bool HasIntersectingLocation(SyntaxTree tree, TextSpan? filterSpanWithinTree = null) 517static bool isLocationWithinSpan(Location location, SyntaxTree tree, TextSpan? filterSpan)
Diagnostic\Location.cs (3)
42public virtual SyntaxTree? SourceTree { get { return null; } } 156/// Creates an instance of a <see cref="Location"/> for a span in a <see cref="SyntaxTree"/>. 158public static Location Create(SyntaxTree syntaxTree, TextSpan textSpan)
Diagnostic\SourceLocation.cs (3)
17private readonly SyntaxTree _syntaxTree; 20public SourceLocation(SyntaxTree syntaxTree, TextSpan span) 72public override SyntaxTree SourceTree
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
97sb.AppendLine($"{nameof(SyntaxTree)}: {_file.Value.SourceTree.FilePath}");
DiagnosticAnalyzer\AnalysisResult.cs (4)
24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 25ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 46public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 51public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; }
DiagnosticAnalyzer\AnalysisResultBuilder.cs (10)
31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 32private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 37private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSemanticDiagnosticsOpt = null; 38private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSyntaxDiagnosticsOpt = null; 46_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 47_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 303static SyntaxTree? getSourceTree(Diagnostic diagnostic) 458Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 505ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics;
DiagnosticAnalyzer\AnalysisScope.cs (5)
55public ImmutableArray<SyntaxTree> SyntaxTrees { get; } 122var trees = filterFile.SourceTree != null ? ImmutableArray.Create(filterFile.SourceTree) : ImmutableArray<SyntaxTree>.Empty; 130ImmutableArray<SyntaxTree> trees, 225public bool ShouldAnalyze(SyntaxTree tree) 245var filterTree = FilterFileOpt.GetValueOrDefault().SourceTree;
DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (1)
63CompilerLoadContext = compilerLoadContext ?? AssemblyLoadContext.GetLoadContext(typeof(SyntaxTree).GetTypeInfo().Assembly)!;
DiagnosticAnalyzer\AnalyzerConfigOptionsProvider.cs (1)
20public abstract AnalyzerConfigOptions GetOptions(SyntaxTree tree);
DiagnosticAnalyzer\AnalyzerDriver.cs (28)
43private readonly Func<SyntaxTree, CancellationToken, bool> _isGeneratedCode; 236private ConcurrentDictionary<SyntaxTree, bool>? _lazyGeneratedCodeFilesMap; 241private ConcurrentDictionary<SyntaxTree, bool> GeneratedCodeFilesMap 250private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>? _lazyGeneratedCodeSymbolsForTreeMap; 255private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>> GeneratedCodeSymbolsForTreeMap 264private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 269private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 311private ConcurrentDictionary<SyntaxTree, bool>? _lazyTreesWithHiddenRegionsMap; 421_lazyGeneratedCodeFilesMap = new ConcurrentDictionary<SyntaxTree, bool>(); 422_lazyGeneratedCodeSymbolsForTreeMap = new Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>(); 424_lazyTreesWithHiddenRegionsMap = new ConcurrentDictionary<SyntaxTree, bool>(); 425_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 753foreach (var tree in analysisScope.SyntaxTrees) 986foreach (var tree in compilation.SyntaxTrees) 1012private SemanticModel GetOrCreateSemanticModel(SyntaxTree tree) 1015protected SemanticModel GetOrCreateSemanticModel(SyntaxTree tree, Compilation compilation) 1297ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1328static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1365private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1375private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 2167SyntaxTree? filterTree, 2194async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2210async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2234static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2327protected bool IsGeneratedCode(SyntaxTree tree, CancellationToken cancellationToken) 2358protected bool IsGeneratedOrHiddenCodeLocation(SyntaxTree syntaxTree, TextSpan span, CancellationToken cancellationToken) 2361protected bool IsHiddenSourceLocation(SyntaxTree syntaxTree, TextSpan span) 2368private bool HasHiddenRegions(SyntaxTree tree)
DiagnosticAnalyzer\AnalyzerExecutor.cs (18)
42private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 45private readonly Func<SyntaxTree, TextSpan, CancellationToken, bool> _isGeneratedCodeLocation; 46private readonly Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> _isAnalyzerSuppressedForTree; 72private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, CancellationToken cancellationToken) 125Func<SyntaxTree, TextSpan, CancellationToken, bool> isGeneratedCodeLocation, 126Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 128Func<SyntaxTree, SemanticModel> getSemanticModel, 159Func<SyntaxTree, TextSpan, CancellationToken, bool> isGeneratedCodeLocation, 160Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 162Func<SyntaxTree, SemanticModel> getSemanticModel, 321SyntaxTree? filterTree, 446SyntaxTree? filterTree, 515SyntaxTree? filterTree, 552SyntaxTree? filterTree, 569SyntaxTree? filterTree, 689var tree = file.SourceTree; 1628SyntaxTree tree, 1640SyntaxTree tree,
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
142SyntaxTree? filterTree,
DiagnosticAnalyzer\AnalyzerManager.cs (4)
95SyntaxTree? filterTree, 109SyntaxTree? filterTree, 189SyntaxTree? filterTree, 320foreach (var tree in analysisScope.SyntaxTrees)
DiagnosticAnalyzer\AnalyzerOptions.cs (1)
25/// A set of options keyed to <see cref="SyntaxTree"/> or <see cref="AdditionalText"/>.
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (1)
35SyntaxTree tree,
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (8)
16/// and should invoke <see cref="ClearCache(SyntaxTree, Compilation)"/> and <see cref="ClearCache(Compilation)"/> to clear entries when appropriate. 40public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default) 43internal void ClearCache(SyntaxTree tree, Compilation compilation) 59private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelsMap; 63private readonly Func<SyntaxTree, SemanticModel> _createSemanticModel; 68_semanticModelsMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 72public SemanticModel GetSemanticModel(SyntaxTree tree, SemanticModelOptions options) 80public void ClearCachedSemanticModel(SyntaxTree tree)
DiagnosticAnalyzer\CompilationUnitCompletedEvent.cs (2)
13public CompilationUnitCompletedEvent(Compilation compilation, SyntaxTree compilationUnit, TextSpan? filterSpan = null) 22public SyntaxTree CompilationUnit { get; }
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (16)
194private void VerifyTree(SyntaxTree tree) 390public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, CancellationToken cancellationToken) 406public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 422public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 440public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 454public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, CancellationToken cancellationToken) 469public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 483public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 500public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 579private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 898var partialTrees = PooledHashSet<SyntaxTree>.GetInstance(); 899var tree = originalFile.SourceTree!; 924foreach (var partialTree in partialTrees) 937bool tryProcessTree(SyntaxTree partialTree, [NotNullWhen(true)] out (AnalysisScope scope, ImmutableArray<CompilationEvent> events)? scopeAndEvents) 1062var tree = analysisScope.FilterFileOpt!.Value.SourceTree!; 1108static bool shouldIncludeSymbol(ISymbolInternal symbol, SyntaxTree tree, CancellationToken cancellationToken)
DiagnosticAnalyzer\CompilerAnalyzerConfigOptionsProvider.cs (1)
28public override AnalyzerConfigOptions GetOptions(SyntaxTree tree)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (30)
119/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 438/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 538/// <param name="tree"><see cref="SyntaxTree"/> instance for which the value is queried.</param> 542public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 660/// <param name="tree"><see cref="SyntaxTree"/> for which the value is queried.</param> 664public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, [MaybeNullWhen(false)] out TValue value) 714public SyntaxTree FilterTree { get; } 799public SyntaxTree? FilterTree { get; } 834SyntaxTree? filterTree, 895public SyntaxTree? FilterTree { get; } 916internal SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, bool isGeneratedCode, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 1058public SyntaxTree FilterTree { get; } 1169public SyntaxTree FilterTree { get; } 1279public SyntaxTree FilterTree { get; } 1316SyntaxTree filterTree, 1422public SyntaxTree FilterTree { get; } 1463SyntaxTree filterTree, 1516/// A syntax tree action can use a <see cref="SyntaxTreeAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="SyntaxTree"/> for a code document. 1520private readonly SyntaxTree _tree; 1528/// <see cref="SyntaxTree"/> that is the subject of the analysis. 1530public SyntaxTree Tree => _tree; 1557public SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1563SyntaxTree tree, 1583/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxTree"/>. 1707public SyntaxTree FilterTree { get; } 1813public SyntaxTree FilterTree { get; } 1896private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 1931Func<SyntaxTree, SemanticModel> getSemanticModel, 1972/// Gets a <see cref="SemanticModel"/> for the given <see cref="SyntaxTree"/>, which is shared across all analyzers. 1974public SemanticModel GetSemanticModel(SyntaxTree syntaxTree) => _getSemanticModel(syntaxTree);
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (2)
238SyntaxTree? filterTree, 342SyntaxTree filterTree,
DiagnosticAnalyzer\SourceOrAdditionalFile.cs (2)
18public SyntaxTree? SourceTree { get; } 21public SourceOrAdditionalFile(SyntaxTree tree)
DiagnosticAnalyzer\SyntaxTreeValueProvider.cs (8)
11/// Provides custom values associated with <see cref="SyntaxTree"/> instances using the given computeValue delegate. 15internal AnalysisValueProvider<SyntaxTree, TValue> CoreValueProvider { get; private set; } 18/// Provides values associated with <see cref="SyntaxTree"/> instances using the given <paramref name="computeValue"/>. 20/// <param name="computeValue">Delegate to compute the value associated with a given <see cref="SyntaxTree"/> instance.</param> 21/// <param name="syntaxTreeComparer">Optional equality comparer to determine equivalent <see cref="SyntaxTree"/> instances that have the same value. 23public SyntaxTreeValueProvider(Func<SyntaxTree, TValue> computeValue, IEqualityComparer<SyntaxTree>? syntaxTreeComparer = null) 25CoreValueProvider = new AnalysisValueProvider<SyntaxTree, TValue>(computeValue, syntaxTreeComparer ?? SyntaxTreeComparer.Instance);
EmbeddedText.cs (1)
37/// <remarks>See remarks of <see cref="SyntaxTree.FilePath"/></remarks>
PEWriter\MetadataWriter.cs (1)
1803foreach (var tree in Module.CommonCompilation.SyntaxTrees)
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
871var tree = location.SourceTree;
SourceGeneration\CompilationCache.cs (9)
40private readonly ImmutableArray<SyntaxTree> _postInitTrees; 48ImmutableArray<SyntaxTree> postInitTrees, 84private readonly ArrayBuilder<SyntaxTree> _postInitTrees = ArrayBuilder<SyntaxTree>.GetInstance(); 86private readonly ArrayBuilder<SyntaxTree> _preCompTreesToAdd = ArrayBuilder<SyntaxTree>.GetInstance(); 96/// Records a post-init <see cref="SyntaxTree"/> in driver order. The flat list of 99public void AddPostInitTree(SyntaxTree tree) => _postInitTrees.Add(tree); 131return new CompilationCache(_compilationWithPostInit, _inputCompilation, ImmutableArray<SyntaxTree>.Empty, ImmutableArray<PreCompCacheKey>.Empty);
SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
SourceGeneration\GeneratedSyntaxTree.cs (2)
18public SyntaxTree Tree { get; } 20public GeneratedSyntaxTree(string hintName, SourceText text, SyntaxTree tree)
SourceGeneration\GeneratorDriver.cs (6)
69ArrayBuilder<SyntaxTree>? trees = null; 77trees = ArrayBuilder<SyntaxTree>.GetInstance(); 247var constantSourcesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 518var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 564var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 683internal abstract SyntaxTree ParseGeneratedSourceText(GeneratedSourceText input, string fileName, CancellationToken cancellationToken);
SourceGeneration\GeneratorDriverState.cs (1)
82/// The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.
SourceGeneration\Nodes\SharedInputNodes.cs (2)
25public static readonly InputNode<SyntaxTree> SyntaxTrees = new InputNode<SyntaxTree>(b => GetCompilationOrThrow(b, nameof(IncrementalGeneratorInitializationContext.SyntaxProvider)).SyntaxTrees.ToImmutableArray());
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
150var targetSyntaxTree = attributeTarget.SyntaxTree;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (7)
53/// cref="SyntaxTree"/>. 55internal IncrementalValuesProvider<(SyntaxTree tree, ImmutableArray<SyntaxNode> matches)> ForAttributeWithSimpleName( 125private static ImmutableArray<(SyntaxTree Tree, SourceGeneratorSyntaxTreeInfo Info)> GetSourceGeneratorInfo( 130foreach (var tree in compilation.CommonSyntaxTrees) 138var builder = ImmutableArray.CreateBuilder<(SyntaxTree Tree, SourceGeneratorSyntaxTreeInfo Info)>(count); 141foreach (var tree in compilation.CommonSyntaxTrees) 154SyntaxTree syntaxTree,
SourceGeneration\RunResults.cs (5)
21private ImmutableArray<SyntaxTree> _lazyGeneratedTrees; 58/// The <see cref="SyntaxTree"/>s produced during this generation pass by parsing each <see cref="SourceText"/> added by each generator. 63public ImmutableArray<SyntaxTree> GeneratedTrees 173internal GeneratedSourceResult(SyntaxTree tree, SourceText text, string hintName) 183public SyntaxTree SyntaxTree { get; }
SourceGeneration\SyntaxStore.cs (2)
49public IStateTable GetSyntaxInputTable(SyntaxInputNode syntaxInputNode, NodeStateTable<SyntaxTree> syntaxTreeTable) 87NodeStateTable<SyntaxTree> syntaxTreeState = syntaxTreeTable;
Symbols\IMethodSymbolInternal.cs (1)
58int CalculateLocalSyntaxOffset(int declaratorPosition, SyntaxTree declaratorTree);
Symbols\ISymbolInternal.cs (1)
190bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default);
Syntax\AbstractWarningStateMap.cs (2)
22protected AbstractWarningStateMap(SyntaxTree syntaxTree) 32protected abstract WarningStateMapEntry[] CreateWarningStateMapEntries(SyntaxTree syntaxTree);
Syntax\ICompilationUnitSyntax.cs (4)
10/// Interface implemented by any node that is the root 'CompilationUnit' of a <see cref="SyntaxTree"/>. i.e. 11/// any node returned by <see cref="SyntaxTree.GetRoot"/> where <see cref="SyntaxTree.HasCompilationUnitRoot"/> 14/// This interface provides a common way to both easily find the root of a <see cref="SyntaxTree"/>
Syntax\LineDirectiveMap.cs (2)
36protected LineDirectiveMap(SyntaxTree syntaxTree) 139private ImmutableArray<LineMappingEntry> CreateEntryMap(SyntaxTree tree, IList<TDirective> directives)
Syntax\SyntaxDiffer.cs (4)
38internal static IList<TextChange> GetTextChanges(SyntaxTree before, SyntaxTree after) 72internal static IList<TextSpan> GetPossiblyDifferentTextSpans(SyntaxTree? before, SyntaxTree? after)
Syntax\SyntaxList.cs (1)
27protected override SyntaxTree SyntaxTreeCore => this.Parent!.SyntaxTree;
Syntax\SyntaxNode.cs (8)
30internal SyntaxTree? _syntaxTree; 46internal SyntaxNode(GreenNode green, int position, SyntaxTree syntaxTree) 78public SyntaxTree SyntaxTree => this.SyntaxTreeCore; 354/// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/> 362/// from <see cref="SyntaxTree.WithChangedText"/>. This can happen as the parser is allowed to construct parse 692var tree = this.SyntaxTree; 1466protected abstract SyntaxTree SyntaxTreeCore { get; } 1687internal static T CloneNodeAsRoot<T>(T node, SyntaxTree syntaxTree) where T : SyntaxNode
Syntax\SyntaxNodeExtensions.cs (1)
445internal static SyntaxNode? AsRootOfNewTreeWithOptionsFrom(this SyntaxNode? node, SyntaxTree oldTree)
Syntax\SyntaxNodeOrToken.cs (1)
824public SyntaxTree? SyntaxTree => _nodeOrParent?.SyntaxTree;
Syntax\SyntaxReference.cs (1)
19public abstract SyntaxTree SyntaxTree { get; }
Syntax\SyntaxToken.cs (5)
638public SyntaxTree? SyntaxTree => Parent?.SyntaxTree; 645var tree = SyntaxTree; 664var tree = SyntaxTree; 690/// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/> 698/// from <see cref="SyntaxTree.WithChangedText"/>. This can happen as the parser is allowed to construct parse
Syntax\SyntaxTree.cs (8)
172public abstract SyntaxTree WithChangedText(SourceText newText); 336public abstract IList<TextSpan> GetChangedSpans(SyntaxTree syntaxTree); 351public abstract bool IsEquivalentTo(SyntaxTree tree, bool topLevel = false); 366public abstract IList<TextChange> GetChanges(SyntaxTree oldTree); 391public abstract SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options); 396public abstract SyntaxTree WithFilePath(string path); 407public virtual SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options) 413/// Returns a <see cref="String" /> that represents the entire source text of this <see cref="SyntaxTree"/>.
Syntax\SyntaxTreeComparer.cs (4)
12internal class SyntaxTreeComparer : IEqualityComparer<SyntaxTree> 16public bool Equals(SyntaxTree? x, SyntaxTree? y) 31public int GetHashCode(SyntaxTree obj)
Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
Syntax\SyntaxTrivia.cs (1)
400public SyntaxTree? SyntaxTree
Syntax\TranslationSyntaxReference.cs (1)
29public sealed override SyntaxTree SyntaxTree
XmlFileResolver.cs (1)
44/// Path of the source file (<see cref="SyntaxTree.FilePath"/>) or XML document that contains the <paramref name="path"/>.
Microsoft.CodeAnalysis.Analyzers (128)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (3)
58var shouldAnalyzeMap = new ConcurrentDictionary<SyntaxTree, bool>(); 254bool ShouldSkipTreeAnalysis(SyntaxTree tree, bool? isGeneratedCode, CancellationToken cancellationToken) 257bool ShouldAnalyzeInTree(SyntaxTree tree, bool? isGeneratedCode, CancellationToken cancellationToken)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>();
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
199foreach (var tree in compilation.SyntaxTrees)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
31public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 48public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (9)
31ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 34private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 36private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions) 67var perTreeOptionsBuilder = PooledDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance(); 68foreach (var tree in compilation.SyntaxTrees) 75static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider) 82public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 100public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 110private bool TryGetOptionValue<T, TArg>(string optionName, OptionKind kind, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, [MaybeNullWhen(false)] out T value)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (30)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 51=> TryGetSyntaxTreeForOption(symbol, out var tree) 58SyntaxTree tree, 69=> TryGetSyntaxTreeForOption(symbol, out var tree) 76SyntaxTree tree, 87=> TryGetSyntaxTreeForOption(symbol, out var tree) 94SyntaxTree tree, 102SyntaxTree tree, 109SyntaxTree tree, 120=> TryGetSyntaxTreeForOption(symbol, out var tree) 127SyntaxTree tree, 136SyntaxTree tree, 152SyntaxTree tree, 179SyntaxTree tree, 192=> TryGetSyntaxTreeForOption(symbol, out var tree) 200SyntaxTree tree, 212SyntaxTree tree, 224SyntaxTree tree, 240SyntaxTree tree, 247SyntaxTree tree, 300=> TryGetSyntaxTreeForOption(symbol, out var tree) 309=> TryGetSyntaxTreeForOption(symbol, out var tree) 324SyntaxTree? tree, 338SyntaxTree? tree, 387SyntaxTree? tree, 426SyntaxTree tree, 434SyntaxTree tree, 441SyntaxTree tree, 448SyntaxTree tree, 456SyntaxTree? tree,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\ICategorizedAnalyzerConfigOptions.cs (2)
51T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality); 53T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
241var destinationTree = destinationDeclaration.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
78var syntaxTree = destination.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
50public SyntaxTree SyntaxTree { get; } = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 59if (document.TryGetSyntaxTree(out var syntaxTree)) 239var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
26var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
15bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 18Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
51var previousSyntaxTree = previousSemanticModel.SyntaxTree; 52var currentSyntaxTree = currentBodyNode.SyntaxTree; 178private readonly SyntaxTree _originalSyntaxTree; 179private readonly SyntaxTree _updatedSyntaxTree; 182public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Microsoft.CodeAnalysis.AnalyzerUtilities (119)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>();
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
199foreach (var tree in compilation.SyntaxTrees)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
31public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 48public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (9)
31ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 34private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 36private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions) 67var perTreeOptionsBuilder = PooledDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance(); 68foreach (var tree in compilation.SyntaxTrees) 75static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider) 82public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 100public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 110private bool TryGetOptionValue<T, TArg>(string optionName, OptionKind kind, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, [MaybeNullWhen(false)] out T value)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (30)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 51=> TryGetSyntaxTreeForOption(symbol, out var tree) 58SyntaxTree tree, 69=> TryGetSyntaxTreeForOption(symbol, out var tree) 76SyntaxTree tree, 87=> TryGetSyntaxTreeForOption(symbol, out var tree) 94SyntaxTree tree, 102SyntaxTree tree, 109SyntaxTree tree, 120=> TryGetSyntaxTreeForOption(symbol, out var tree) 127SyntaxTree tree, 136SyntaxTree tree, 152SyntaxTree tree, 179SyntaxTree tree, 192=> TryGetSyntaxTreeForOption(symbol, out var tree) 200SyntaxTree tree, 212SyntaxTree tree, 224SyntaxTree tree, 240SyntaxTree tree, 247SyntaxTree tree, 300=> TryGetSyntaxTreeForOption(symbol, out var tree) 309=> TryGetSyntaxTreeForOption(symbol, out var tree) 324SyntaxTree? tree, 338SyntaxTree? tree, 387SyntaxTree? tree, 426SyntaxTree tree, 434SyntaxTree tree, 441SyntaxTree tree, 448SyntaxTree tree, 456SyntaxTree? tree,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\ICategorizedAnalyzerConfigOptions.cs (2)
51T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality); 53T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\InterproceduralAnalysisConfiguration.cs (2)
55SyntaxTree tree, 101var tree = operation.Syntax.SyntaxTree;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Options\AnalyzerOptionsExtensions_FlowAnalysis.cs (12)
20=> TryGetSyntaxTreeForOption(symbol, out var tree) 27SyntaxTree tree, 38=> TryGetSyntaxTreeForOption(symbol, out var tree) 45SyntaxTree tree, 56=> TryGetSyntaxTreeForOption(symbol, out var tree) 63SyntaxTree tree, 74=> TryGetSyntaxTreeForOption(symbol, out var tree) 81SyntaxTree tree, 92=> TryGetSyntaxTreeForOption(symbol, out var tree) 99SyntaxTree tree, 110=> TryGetSyntaxTreeForOption(symbol, out var tree) 117SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
Microsoft.CodeAnalysis.CodeStyle (87)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
109SyntaxTree tree, 117SyntaxTree tree, 147SyntaxTree tree,
src\roslyn\src\Analyzers\Core\Analyzers\AnalyzerOptionsProvider.cs (1)
87public static AnalyzerOptionsProvider GetAnalyzerOptions(this AnalyzerOptions analyzerOptions, SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (1)
98internal Location GetLocation(SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\roslyn\src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (2)
58var sourceTree = symbolContext.Symbol.Locations.FirstOrDefault()?.SourceTree; 112SyntaxTree sourceTree,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
64var tree = model.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
87var tree = context.SemanticModel.SyntaxTree; 93protected virtual void AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxTree tree, CancellationToken cancellationToken) 132var tree = compilation.SyntaxTrees.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken)); 199IEnumerable<TextSpan> contiguousSpans, SyntaxTree tree, 214IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 217IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
98var tree = semanticModel.SyntaxTree; 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 508SyntaxTree tree, 545SyntaxTree tree,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
772foreach (var tree in namedTypeSymbol.Locations.Select(l => l.SourceTree).Distinct().WhereNotNull()) 796var syntaxTree = group.Key;
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
109protected abstract bool SupportsDiscard(SyntaxTree tree); 199SyntaxTree syntaxTree,
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
149var tree = model.SyntaxTree; 208private readonly ConcurrentDictionary<SyntaxTree, (StrongBox<bool> completed, TextSpanMutableIntervalTree? intervalTree)> _codeBlockIntervals = [];
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
152var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
Microsoft.CodeAnalysis.CodeStyle.Fixes (25)
src\roslyn\src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
16var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
19protected abstract Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
57var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
74var tree = await this.Document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
34var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
241var destinationTree = destinationDeclaration.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
78var syntaxTree = destination.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
50public SyntaxTree SyntaxTree { get; } = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 59if (document.TryGetSyntaxTree(out var syntaxTree)) 239var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
26var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
15bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 18Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
51var previousSyntaxTree = previousSemanticModel.SyntaxTree; 52var currentSyntaxTree = currentBodyNode.SyntaxTree; 178private readonly SyntaxTree _originalSyntaxTree; 179private readonly SyntaxTree _updatedSyntaxTree; 182public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Microsoft.CodeAnalysis.CSharp (360)
Binder\Binder.cs (1)
283internal bool AreNullableAnnotationsEnabled(SyntaxTree syntaxTree, int position)
Binder\Binder_Attributes.cs (1)
413protected bool IsAttributeConditionallyOmitted(NamedTypeSymbol attributeType, SyntaxTree? syntaxTree, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Binder_Initializers.cs (1)
194var syntaxTree = syntaxRef.SyntaxTree;
Binder\Binder_Symbols.cs (3)
2829internal static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, BindingDiagnosticBag diagnostics, Location location) 2838private static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, Location location) 2844private static bool CheckFeatureAvailability<TData>(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, TData data, Func<TData, Location> getLocation, bool forceWarning = false)
Binder\BinderFactory.BinderFactoryVisitor.cs (3)
53private SyntaxTree syntaxTree 631private static bool InSpan(Location location, SyntaxTree syntaxTree, TextSpan span) 640private static bool InSpan(ImmutableArray<Location> locations, SyntaxTree syntaxTree, TextSpan span)
Binder\BinderFactory.cs (3)
51private readonly SyntaxTree _syntaxTree; 63internal BinderFactory(CSharpCompilation compilation, SyntaxTree syntaxTree, bool ignoreAccessibility, ObjectPool<BinderFactoryVisitor> binderFactoryVisitorPoolOpt = null) 82internal SyntaxTree SyntaxTree
Binder\WithNullableContextBinder.cs (2)
13private readonly SyntaxTree _syntaxTree; 16internal WithNullableContextBinder(SyntaxTree syntaxTree, int position, Binder next)
BoundTree\BoundNode.cs (1)
145public SyntaxTree? SyntaxTree
CodeGen\CodeGenerator.cs (1)
517private TextSpan EmitSequencePoint(SyntaxTree syntaxTree, TextSpan span)
CommandLine\CSharpCompiler.cs (5)
54var trees = new SyntaxTree?[sourceFiles.Length]; 173private SyntaxTree? ParseFile( 201private static SyntaxTree ParseFile( 207var tree = SyntaxFactory.ParseSyntaxTree( 345SyntaxTree tree,
Compilation\CSharpCompilation.cs (89)
138private HashSet<SyntaxTree>? _lazyCompilationUnitCompletedTrees; 144private ImmutableHashSet<SyntaxTree>? _usageOfUsingsRecordedInTrees = ImmutableHashSet<SyntaxTree>.Empty; 146internal ImmutableHashSet<SyntaxTree>? UsageOfUsingsRecordedInTrees => Volatile.Read(ref _usageOfUsingsRecordedInTrees); 155private ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> _mappedPathToSyntaxTree; 159private ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> _pathToSyntaxTree; 162private ImmutableSegmentedDictionary<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>> _contentHashToSyntaxTree; 441IEnumerable<SyntaxTree>? syntaxTrees = null, 461SyntaxTree? syntaxTree = null, 474(syntaxTree != null) ? new[] { syntaxTree } : SpecializedCollections.EmptyEnumerable<SyntaxTree>(), 485IEnumerable<SyntaxTree>? syntaxTrees, 517ImmutableArray<SyntaxTree>.Empty, 617private static LanguageVersion CommonLanguageVersion(ImmutableArray<SyntaxTree> syntaxTrees) 620foreach (var tree in syntaxTrees) 857var tree = _syntaxAndDeclarations.ExternalSyntaxTrees.SingleOrDefault(); 903public new ImmutableArray<SyntaxTree> SyntaxTrees 911public new bool ContainsSyntaxTree(SyntaxTree? syntaxTree) 919public new CSharpCompilation AddSyntaxTrees(params SyntaxTree[] trees) 921return AddSyntaxTrees((IEnumerable<SyntaxTree>)trees); 927public new CSharpCompilation AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 943var externalSyntaxTrees = PooledHashSet<SyntaxTree>.GetInstance(); 991public new CSharpCompilation RemoveSyntaxTrees(params SyntaxTree[] trees) 993return RemoveSyntaxTrees((IEnumerable<SyntaxTree>)trees); 1000public new CSharpCompilation RemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 1012var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 1017var externalSyntaxTrees = PooledHashSet<SyntaxTree>.GetInstance(); 1059syntaxAndDeclarations: syntaxAndDeclarations.WithExternalSyntaxTrees(ImmutableArray<SyntaxTree>.Empty)); 1065public new CSharpCompilation ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree? newTree) 1119internal override int GetSyntaxTreeOrdinal(SyntaxTree tree) 1134internal OneOrMany<SyntaxTree> GetSyntaxTreesByMappedPath(string mappedPath) 1149return mappedPathToSyntaxTree.TryGetValue(mappedPath, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1151ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> computeMappedPathToSyntaxTree() 1153var builder = ImmutableSegmentedDictionary.CreateBuilder<string, OneOrMany<SyntaxTree>>(); 1155foreach (var tree in SyntaxTrees) 1164internal OneOrMany<SyntaxTree> GetSyntaxTreesByContentHash(ReadOnlyMemory<byte> contentHash) 1175return contentHashToSyntaxTree.TryGetValue(contentHash, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1177ImmutableSegmentedDictionary<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>> computeHashToSyntaxTree() 1179var builder = ImmutableSegmentedDictionary.CreateBuilder<ReadOnlyMemory<byte>, OneOrMany<SyntaxTree>>(ContentHashComparer.Instance); 1180foreach (var tree in SyntaxTrees) 1190internal OneOrMany<SyntaxTree> GetSyntaxTreesByPath(string path) 1202return pathToSyntaxTree.TryGetValue(path, out var value) ? value : OneOrMany<SyntaxTree>.Empty; 1204ImmutableSegmentedDictionary<string, OneOrMany<SyntaxTree>> computePathToSyntaxTree() 1206var builder = ImmutableSegmentedDictionary.CreateBuilder<string, OneOrMany<SyntaxTree>>(); 1207foreach (var tree in SyntaxTrees) 1640internal bool IsSubmissionSyntaxTree(SyntaxTree tree) 1704var tree = _syntaxAndDeclarations.ExternalSyntaxTrees.SingleOrDefault(); 2608public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility) 2617public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 2640internal override SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 2654internal BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool ignoreAccessibility = false) 2664private BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool ignoreAccessibility, ref WeakReference<BinderFactory>[]? cachedBinderFactories) 2686private BinderFactory AddNewFactory(SyntaxTree syntaxTree, bool ignoreAccessibility, [NotNull] ref WeakReference<BinderFactory>? slot) 2718private void CompleteTree(SyntaxTree tree) 2720if (_lazyCompilationUnitCompletedTrees == null) Interlocked.CompareExchange(ref _lazyCompilationUnitCompletedTrees, new HashSet<SyntaxTree>(), null); 2747private void ReportUnusedImports(SyntaxTree? filterTree, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken) 2763SyntaxTree infoTree = info.Tree; 2840internal override void CompleteTrees(SyntaxTree? filterTree) 2853foreach (var tree in this.SyntaxTrees) 2891public readonly SyntaxTree Tree; 2895public ImportInfo(SyntaxTree tree, SyntaxKind kind, TextSpan span) 3056var syntaxTree = syntaxTrees[i]; 3064foreach (var syntaxTree in syntaxTrees) 3075foreach (var syntaxTree in syntaxTrees) 3135private static void AppendLoadDirectiveDiagnostics(DiagnosticBag builder, SyntaxAndDeclarationManager syntaxAndDeclarations, SyntaxTree syntaxTree, Func<IEnumerable<Diagnostic>, IEnumerable<Diagnostic>>? locationFilterOpt = null) 3181private static bool IsDefinedOrImplementedInSourceTree(Symbol symbol, SyntaxTree tree, TextSpan? span) 3199public SyntaxTree Tree { get; } 3203public MethodBodyDiagnostics(SyntaxTree tree, TextSpan? span, ImmutableArray<Diagnostic> diagnostics) 3211private ImmutableArray<Diagnostic> GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, TextSpan? span, CancellationToken cancellationToken) 3277foreach (var otherTree in SyntaxTrees) 3308void updateCachedDiagnostics(ImmutableArray<Diagnostic> diagnostics, SyntaxTree tree, TextSpan? span) 3344void compileMethodBodiesAndDocComments(SyntaxTree? filterTree, TextSpan? filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken) 3359void registeredUsageOfUsingsInTree(SyntaxTree tree) 3395private ReadOnlyBindingDiagnostic<AssemblySymbol> GetSourceDeclarationDiagnostics(SyntaxTree? syntaxTree = null, TextSpan? filterSpanWithinTree = null, Func<IEnumerable<Diagnostic>, SyntaxTree, TextSpan?, IEnumerable<Diagnostic>>? locationFilterOpt = null, Predicate<Symbol>? symbolFilter = null, CancellationToken cancellationToken = default) 3444private ReadOnlyBindingDiagnostic<AssemblySymbol> GetClsComplianceDiagnostics(SyntaxTree? syntaxTree, TextSpan? filterSpanWithinTree, CancellationToken cancellationToken) 3467private static IEnumerable<Diagnostic> FilterDiagnosticsByLocation(IEnumerable<Diagnostic> diagnostics, SyntaxTree tree, TextSpan? filterSpanWithinTree) 3480SyntaxTree syntaxTree, 3781public bool CheckDuplicateFilePathsAndFree(ImmutableArray<SyntaxTree> syntaxTrees, NamespaceSymbol globalNamespace) 3784foreach (var tree in syntaxTrees) 4017SyntaxTree tree, 4116foreach (var syntaxTree in this.SyntaxTrees) 4158protected override SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 4163protected internal override ImmutableArray<SyntaxTree> CommonSyntaxTrees 4171protected override Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees) 4176protected override Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 4186protected override Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree? newTree) 4201protected override bool CommonContainsSyntaxTree(SyntaxTree? syntaxTree)
Compilation\CSharpSemanticModel.cs (4)
25/// cref="Compilation.GetSemanticModel(SyntaxTree, bool)"/>. 2800public new abstract SyntaxTree SyntaxTree 4999protected sealed override SyntaxTree SyntaxTreeCore 5284var tree = nameSyntax.SyntaxTree;
Compilation\MemberSemanticModel.cs (1)
1186public override SyntaxTree SyntaxTree
Compilation\MemberSemanticModel.NodeMapBuilder.cs (3)
21private NodeMapBuilder(OrderPreservingMultiDictionary<SyntaxNode, BoundNode> map, SyntaxTree tree, SyntaxNode thisSyntaxNodeOnly) 29private readonly SyntaxTree _tree; 39public static void AddToMap(BoundNode root, Dictionary<SyntaxNode, OneOrMany<BoundNode>> map, SyntaxTree tree, SyntaxNode node = null)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
129public override SyntaxTree SyntaxTree => _memberModel.SyntaxTree;
Compilation\SyntaxAndDeclarationManager.cs (73)
28ImmutableArray<SyntaxTree> externalSyntaxTrees, 50ImmutableArray<SyntaxTree> externalSyntaxTrees, 56var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 57var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 58var loadDirectiveMapBuilder = PooledDictionary<SyntaxTree, ImmutableArray<LoadDirective>>.GetInstance(); 59var loadedSyntaxTreeMapBuilder = PooledDictionary<string, SyntaxTree>.GetInstance(); 60var declMapBuilder = PooledDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.GetInstance(); 61var lastComputedMemberNamesMap = PooledDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>>.GetInstance(); 64foreach (var tree in externalSyntaxTrees) 91public SyntaxAndDeclarationManager AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 112var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 115foreach (var tree in trees) 154ArrayBuilder<SyntaxTree> treesBuilder, 155SyntaxTree tree, 160IDictionary<SyntaxTree, int> ordinalMapBuilder, 161IDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMapBuilder, 162IDictionary<string, SyntaxTree> loadedSyntaxTreeMapBuilder, 163IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 164IDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNamesMap, 189ArrayBuilder<SyntaxTree> treesBuilder, 190SyntaxTree tree, 195IDictionary<SyntaxTree, int> ordinalMapBuilder, 196IDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMapBuilder, 197IDictionary<string, SyntaxTree> loadedSyntaxTreeMapBuilder, 198IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 199IDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNamesMap, 241var loadedTree = SyntaxFactory.ParseSyntaxTree( 292SyntaxTree tree, 295IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder, 304public SyntaxAndDeclarationManager RemoveSyntaxTrees(HashSet<SyntaxTree> trees) 316var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 317foreach (var tree in trees) 333var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 334var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 338foreach (var tree in syntaxTrees) 383SyntaxTree oldTree, 385ImmutableArray<SyntaxTree> syntaxTrees, 386ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 387ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 388ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 389HashSet<SyntaxTree> removeSet, 414var tree = syntaxTrees[i]; 421SyntaxTree loadedTree; 434ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 435ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 436HashSet<SyntaxTree> removeSet) 442SyntaxTree loadedTree; 457SyntaxTree tree, 458IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMap, 466public SyntaxAndDeclarationManager ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree) 481var removeSet = PooledHashSet<SyntaxTree>.GetInstance(); 504foreach (var tree in removeSet) 514ImmutableArray<SyntaxTree> newTrees; 523var treesBuilder = ArrayBuilder<SyntaxTree>.GetInstance(); 524var ordinalMapBuilder = PooledDictionary<SyntaxTree, int>.GetInstance(); 527var tree = syntaxTrees[i]; 548var tree = syntaxTrees[i]; 606SyntaxTree oldTree, 607ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.Builder declMapBuilder, 608ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>>.Builder lastComputedMemberNamesMap) 663internal SyntaxAndDeclarationManager WithExternalSyntaxTrees(ImmutableArray<SyntaxTree> trees) 668internal static bool IsLoadedSyntaxTree(SyntaxTree tree, ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 670SyntaxTree loadedTree; 675ArrayBuilder<SyntaxTree> treesBuilder, 676SyntaxTree tree, 677IDictionary<SyntaxTree, int> ordinalMapBuilder, 678ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 679ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 697SyntaxTree loadedTree; 728private static bool TryGetLoadedSyntaxTree(ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, LoadDirective directive, out SyntaxTree loadedTree)
Compilation\SyntaxAndDeclarationManager.LazyState.cs (13)
20internal readonly ImmutableArray<SyntaxTree> SyntaxTrees; // In ordinal order. 21internal readonly ImmutableDictionary<SyntaxTree, int> OrdinalMap; // Inverse of syntaxTrees array (i.e. maps tree to index) 22internal readonly ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> LoadDirectiveMap; 23internal readonly ImmutableDictionary<string, SyntaxTree> LoadedSyntaxTreeMap; 24internal readonly ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> RootNamespaces; 43internal readonly ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> LastComputedMemberNames; 47ImmutableArray<SyntaxTree> syntaxTrees, 48ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 49ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 50ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 51ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> rootNamespaces, 52ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNames, 56Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer<SyntaxTree>.Default));
Compilation\SyntaxTreeSemanticModel.cs (5)
28private readonly SyntaxTree _syntaxTree; 44internal SyntaxTreeSemanticModel(CSharpCompilation compilation, SyntaxTree syntaxTree, SemanticModelOptions options) 53internal SyntaxTreeSemanticModel(CSharpCompilation parentCompilation, SyntaxTree parentSyntaxTree, SyntaxTree speculatedSyntaxTree, SemanticModelOptions options) 86public override SyntaxTree SyntaxTree
Compiler\ClsComplianceChecker.cs (3)
27private readonly SyntaxTree _filterTree; //if not null, limit analysis to types residing in this tree 39SyntaxTree filterTree, 73public static void CheckCompliance(CSharpCompilation compilation, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken, SyntaxTree filterTree = null, TextSpan? filterSpanWithinTree = null)
Compiler\DocumentationCommentCompiler.cs (4)
36private readonly SyntaxTree _filterTree; //if not null, limit analysis to types residing in this tree 54SyntaxTree filterTree, 85public static void WriteDocumentationCommentXml(CSharpCompilation compilation, string? assemblyName, Stream? xmlDocStream, BindingDiagnosticBag diagnostics, CancellationToken cancellationToken, SyntaxTree? filterTree = null, TextSpan? filterSpanWithinTree = null) 123foreach (SyntaxTree tree in compilation.SyntaxTrees)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
547private static Binder MakeNameBinder(bool isParameter, bool isTypeParameterRef, Symbol memberSymbol, CSharpCompilation compilation, SyntaxTree syntaxTree)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
29public static void ReportUnprocessed(SyntaxTree tree, TextSpan? filterSpanWithinTree, DiagnosticBag diagnostics, CancellationToken cancellationToken)
CSharpExtensions.cs (6)
395public static CompilationUnitSyntax GetCompilationUnitRoot(this SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken)) 400internal static bool HasReferenceDirectives([NotNullWhen(true)] this SyntaxTree? tree) 406internal static bool HasReferenceOrLoadDirectives([NotNullWhen(true)] this SyntaxTree? tree) 412internal static bool IsAnyPreprocessorSymbolDefined([NotNullWhen(true)] this SyntaxTree? tree, ImmutableArray<string> conditionalSymbols) 418internal static bool IsPreprocessorSymbolDefined([NotNullWhen(true)] this SyntaxTree? tree, string symbolName, int position) 425internal static PragmaWarningState GetPragmaDirectiveWarningState(this SyntaxTree tree, string id, int position)
Declarations\DeclarationTreeBuilder.cs (3)
41private readonly SyntaxTree _syntaxTree; 76SyntaxTree syntaxTree, 88SyntaxTree syntaxTree,
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
76var tree = trivia.SyntaxTree;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
227internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
254internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (1)
51internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
SourceGeneration\CSharpGeneratorDriver.cs (1)
70internal override SyntaxTree ParseGeneratedSourceText(GeneratedSourceText input, string fileName, CancellationToken cancellationToken)
SymbolDisplay\SymbolDisplay.cs (2)
85/// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param> 176/// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param>
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
230internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\ErrorMethodSymbol.cs (1)
271internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Extensions\RewrittenMethodSymbol.cs (1)
71internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\FileIdentifier.cs (1)
92public static FileIdentifier Create(SyntaxTree syntaxTree, SourceReferenceResolver? resolver)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
859internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => throw ExceptionUtilities.Unreachable();
Symbols\LexicalSortKey.cs (1)
62private LexicalSortKey(SyntaxTree tree, int position, CSharpCompilation compilation)
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1692internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\MethodSymbol.cs (4)
524internal virtual bool CallsAreOmitted(SyntaxTree syntaxTree) 537private bool CallsAreConditionallyOmitted(SyntaxTree syntaxTree) 1160internal abstract int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree); 1251int IMethodSymbolInternal.CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => CalculateLocalSyntaxOffset(localPosition, localTree);
Symbols\NativeIntegerTypeSymbol.cs (1)
410internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\ReducedExtensionMethodSymbol.cs (3)
140var syntaxTree = CSharpSyntaxTree.Dummy; 556internal override bool CallsAreOmitted(SyntaxTree syntaxTree) 583internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
381internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\SignatureOnlyMethodSymbol.cs (1)
181internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) { throw ExceptionUtilities.Unreachable(); }
Symbols\Source\LambdaSymbol.cs (1)
437internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\LocalFunctionSymbol.cs (1)
434internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\SourceAssemblySymbol.cs (1)
1559var tree = rootNs.Location.SourceTree;
Symbols\Source\SourceConstructorSymbolBase.cs (1)
178internal sealed override int CalculateLocalSyntaxOffset(int position, SyntaxTree tree)
Symbols\Source\SourceEventSymbol.cs (1)
516internal SyntaxTree SyntaxTree
Symbols\Source\SourceFieldSymbol.cs (2)
189public SyntaxTree SyntaxTree 228public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default)
Symbols\Source\SourceMemberContainerSymbol.cs (8)
970private SyntaxTree? AssociatedSyntaxTree => IsFileLocal ? declaration.Declarations[0].Location.SourceTree : null; 976if (AssociatedSyntaxTree is not SyntaxTree syntaxTree) 1127public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken) 1209internal int CalculateSyntaxOffsetInSynthesizedConstructor(int position, SyntaxTree tree, bool isStatic) 1252internal bool TryCalculateSyntaxOffsetOfPositionInInitializer(int position, SyntaxTree tree, bool isStatic, int ctorInitializerLength, out int syntaxOffset) 1283static bool findInitializer(ImmutableArray<ImmutableArray<FieldOrPropertyInitializer>> initializers, int position, SyntaxTree tree, 1437var conflictDict = new Dictionary<(string name, int arity, SyntaxTree? syntaxTree), SourceNamedTypeSymbol>(); 2040var tree = declaration.Declarations[0].SyntaxReference.SyntaxTree;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
676public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken))
Symbols\Source\SourceMemberMethodSymbol.cs (1)
1144internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
92internal SyntaxTree SyntaxTree 1074SyntaxTree? matchingTree = matchingTrees[0]; 1230var suffixMatch = syntaxTrees.FirstOrDefault(static (tree, attributeFilePathWithForwardSlashes) 1254SyntaxTree? matchingTree = matchingTrees[0];
Symbols\Source\SourceNamedTypeSymbol.cs (2)
159var syntaxTree = syntaxRef.SyntaxTree; 1295var syntaxTree = list.Node.SyntaxTree;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
888static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes, SyntaxTree tree)
Symbols\Source\SourceNamespaceSymbol.cs (3)
108public override bool HasLocationContainedWithin(SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 388var leftTree = possibleFileLocalType.MergedDeclaration.Declarations[0].Location.SourceTree; 460public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
474SyntaxTree tree, 658internal sealed override bool CallsAreOmitted(SyntaxTree syntaxTree)
Symbols\Source\SourcePropertySymbol.cs (1)
554var syntaxTree = SyntaxTree;
Symbols\Source\SourcePropertySymbolBase.cs (1)
870internal SyntaxTree SyntaxTree
Symbols\SubstitutedMethodSymbol.cs (2)
309internal sealed override bool CallsAreOmitted(SyntaxTree syntaxTree) 368internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Symbol.cs (4)
438public virtual bool HasLocationContainedWithin(SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 450protected static bool IsLocationContainedWithin(Location loc, SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 939public virtual bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken = default(CancellationToken)) 960protected static bool IsDefinedInSourceTree(SyntaxReference syntaxRef, SyntaxTree tree, TextSpan? definedWithinSpan)
Symbols\SymbolDistinguisher.cs (1)
166var tree = syntaxReferences[0].SyntaxTree;
Symbols\Synthesized\SynthesizedCollectionBuilderProjectedMethodSymbol.cs (1)
115internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) => throw ExceptionUtilities.Unreachable();
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
284internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) 291var syntaxTree = CSharpSyntaxTree.Dummy;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
350internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
268internal sealed override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
233internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
415internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedMethodSymbol.cs (1)
83internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
209internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree) 270public override bool IsDefinedInSourceTree(SyntaxTree tree, TextSpan? definedWithinSpan, CancellationToken cancellationToken)
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
379internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
Syntax\CSharpLineDirectiveMap.cs (1)
16public CSharpLineDirectiveMap(SyntaxTree syntaxTree)
Syntax\CSharpPragmaWarningStateMap.cs (3)
39public CSharpPragmaWarningStateMap(SyntaxTree syntaxTree) : 44protected override WarningStateMapEntry[] CreateWarningStateMapEntries(SyntaxTree syntaxTree) 58private static void GetAllPragmaWarningDirectives(SyntaxTree syntaxTree, ArrayBuilder<DirectiveTriviaSyntax> directiveList)
Syntax\CSharpSyntaxNode.cs (7)
35internal CSharpSyntaxNode(GreenNode green, int position, SyntaxTree syntaxTree) 46internal new SyntaxTree SyntaxTree 50var result = this._syntaxTree ?? ComputeSyntaxTree(this); 56private static SyntaxTree ComputeSyntaxTree(CSharpSyntaxNode node) 59SyntaxTree? tree = null; 99var existingTree = n._syntaxTree; 454protected override SyntaxTree SyntaxTreeCore
Syntax\CSharpSyntaxTree.cs (22)
28internal static readonly SyntaxTree Dummy = new DummySyntaxTree(); 109/// Ensure that <see cref="SyntaxTree.HasCompilationUnitRoot"/> is true for this tree prior to invoking this method. 111/// <exception cref="InvalidCastException">Throws this exception if <see cref="SyntaxTree.HasCompilationUnitRoot"/> is false.</exception> 125public override bool IsEquivalentTo(SyntaxTree tree, bool topLevel = false) 313public static SyntaxTree Create(CSharpSyntaxNode root, CSharpParseOptions? options = null, string? path = "", Encoding? encoding = null) 329public static SyntaxTree Create( 356internal static SyntaxTree Create( 379internal static SyntaxTree CreateForDebugger(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options) 394internal static SyntaxTree CreateWithoutClone(CSharpSyntaxNode root, CSharpParseOptions options) 414internal static SyntaxTree ParseTextLazy( 429public static SyntaxTree ParseText( 450public static SyntaxTree ParseText( 469public static SyntaxTree ParseText( 489public static SyntaxTree ParseText( 535public override SyntaxTree WithChangedText(SourceText newText) 554private SyntaxTree WithChanges(SourceText newText, IReadOnlyList<TextChangeRange> changes) 598public override IList<TextSpan> GetChangedSpans(SyntaxTree oldTree) 613public override IList<TextChange> GetChanges(SyntaxTree oldTree) 659/// otherwise it's <see cref="SyntaxTree.FilePath"/>. 902public static SyntaxTree ParseText( 913public static SyntaxTree ParseText( 925public static SyntaxTree Create(
Syntax\CSharpSyntaxTree.Dummy.cs (2)
94public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 97public override SyntaxTree WithFilePath(string path)
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (4)
70var tree = SyntaxFactory.ParseSyntaxTree(_text, _options, _path, cancellationToken); 109public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 128public override SyntaxTree WithFilePath(string path) 155public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (3)
123public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 142public override SyntaxTree WithFilePath(string path) 162public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\NullableContextStateMap.cs (2)
44internal static NullableContextStateMap Create(SyntaxTree tree) 136private static ImmutableArray<NullableContextState> GetContexts(SyntaxTree tree)
Syntax\SimpleSyntaxReference.cs (1)
22public override SyntaxTree SyntaxTree
Syntax\SyntaxEquivalence.cs (2)
19internal static bool AreEquivalent(SyntaxTree? before, SyntaxTree? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
Syntax\SyntaxExtensions.cs (1)
177internal static bool ReportDocumentationCommentDiagnostics(this SyntaxTree tree)
Syntax\SyntaxFactory.cs (10)
1576public static SyntaxTree SyntaxTree(SyntaxNode root, ParseOptions? options = null, string path = "", Encoding? encoding = null) 1584public static SyntaxTree ParseSyntaxTree( 1596public static SyntaxTree ParseSyntaxTree( 1977public static bool AreEquivalent(SyntaxTree? oldTree, SyntaxTree? newTree, bool topLevel) 2363public static bool IsCompleteSubmission(SyntaxTree tree) 2830public static SyntaxTree ParseSyntaxTree( 2844public static SyntaxTree ParseSyntaxTree( 2857public static SyntaxTree ParseSyntaxTree( 2872public static SyntaxTree ParseSyntaxTree(
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
20public static IEnumerable<Diagnostic> EnumerateDiagnostics(SyntaxTree syntaxTree, GreenNode root, int position)
Microsoft.CodeAnalysis.CSharp.CodeStyle (75)
src\roslyn\src\Analyzers\CSharp\Analyzers\CodeStyle\CSharpAnalyzerOptionsProvider.cs (2)
99public static CSharpAnalyzerOptionsProvider GetCSharpAnalyzerOptions(this AnalyzerOptions options, SyntaxTree syntaxTree) 117public static CSharpAnalyzerOptionsProvider GetCSharpAnalyzerOptions(this SymbolStartAnalysisContext context, SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
34var syntaxTree = namespaceDeclaration.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
65var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
129var tree = context.SemanticModel.SyntaxTree; 174var tree = syntaxContext.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryAsyncModifier\CSharpMakeMethodSynchronousDiagnosticAnalyzer.cs (1)
45var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
54IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken) 71protected override void AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxTree tree, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
59var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (3)
179public static SyntaxTreeState Create(bool defaultCompleted, NullableContextOptions compilationOptions, SyntaxTree tree, CancellationToken cancellationToken) 259private readonly ConcurrentDictionary<SyntaxTree, SyntaxTreeState> _codeBlockIntervals = []; 316private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (3)
52var originalTree = semanticModel.SyntaxTree; 81var originalTree = semanticModel.SyntaxTree; 84var updatedTree = originalTree.WithRootAndOptions(
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\UnnecessaryUnsafeModifierUtilities.cs (3)
42var originalTree = semanticModel.SyntaxTree; 96var originalTree = semanticModel.SyntaxTree; 99var updatedTree = originalTree.WithRootAndOptions(
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
29protected override bool SupportsDiscard(SyntaxTree tree)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (3)
38var syntaxTree = semanticModel.SyntaxTree; 141var syntaxTree = semanticModel.SyntaxTree; 205SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, NotificationOption2 notification, ExpressionSyntax expression, bool changesSemantics)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
28var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
43var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
44var syntaxTree = semanticModel.SyntaxTree; 86var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
39var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
40var syntaxTree = context.SemanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
38var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (1)
39var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
58var syntaxTree = expression.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
81SyntaxTree? currentSyntaxTree = null; 100var fieldSyntaxTree = fieldSyntaxReference.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
15public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
246var syntaxTree = genericIdentifier.SyntaxTree!;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (29)
17public static ISet<SyntaxKind> GetPrecedingModifiers(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 21this SyntaxTree syntaxTree, 42this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 48this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 54this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 80this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 92public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, SyntaxToken targetToken, CancellationToken cancellationToken) 99public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 102public static bool IsRightOfDot(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken) 119public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 125public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken) 133public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 145public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 155public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 168public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 180this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 224this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 242this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 259this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 273this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 297this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 382this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 389public static bool IsEntirelyWithinStringLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 393this SyntaxTree syntaxTree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken) 442this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 470this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 532public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 540public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
154this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
128public bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132public bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken) 1013public TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1442public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
278var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
168var tree = semanticModel.SyntaxTree; 179var newTree = tree.WithRootAndOptions(newRoot, tree.Options);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (83)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (3)
111var syntaxTree = document.SyntaxTree; 197var syntaxTree = document.SyntaxTree; 214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
45protected override async Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
42var syntaxTree = semanticDocument.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
45var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
533var syntaxTree = group.Key;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (3)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options); 203var contextTree = contextLocation != null && contextLocation.IsInSource
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
187var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (64)
29public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 78this SyntaxTree syntaxTree, 138this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 240this SyntaxTree syntaxTree, 320this SyntaxTree syntaxTree, 336public static bool IsLocalFunctionDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 340this SyntaxTree syntaxTree, 369this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 529this SyntaxTree syntaxTree, 622this SyntaxTree syntaxTree, 676public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 693public static bool IsPartialTypeDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, [NotNullWhen(true)] out TypeDeclarationSyntax? declarationSyntax) 715public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 726this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 776public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 794public static bool IsUsingAliasTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 810public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 822this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 850this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 868public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 899public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 911public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 924this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 937this SyntaxTree syntaxTree, 962public static bool IsGenericConstraintContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 967this SyntaxTree syntaxTree, 1055this SyntaxTree syntaxTree, 1145this SyntaxTree syntaxTree, 1173this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1188this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1202public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1219public static bool IsPossibleExtensionMethodContext(this SyntaxTree syntaxTree, SyntaxToken tokenOnLeftOfPosition) 1231this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1263this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1290this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1315public static bool IsPossibleTupleContext(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1370public static bool IsAtStartOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1464public static bool IsAtEndOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1607public static bool IsPossibleDeconstructionDesignation(this SyntaxTree syntaxTree, 1717this SyntaxTree syntaxTree, 1757this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1774this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1888this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1905public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1922public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1934this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1952private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1959public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1966public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1984public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2007public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2038this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 2051public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2065public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, 2145public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2171this SyntaxTree syntaxTree, 2749public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2816this SyntaxTree syntaxTree, 2938this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2973public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2998public static bool IsBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3011public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3023public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 3078public static bool IsFunctionPointerCallingConventionContext(this SyntaxTree syntaxTree, SyntaxToken targetToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
14public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 22public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 32this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 38this SyntaxTree syntaxTree, 47this SyntaxTree syntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
28public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
196var syntaxTree = SemanticModel.SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Features (157)
BraceCompletion\AbstractCSharpBraceCompletionService.cs (1)
18protected static bool IsLegalExpressionLocation(SyntaxTree tree, int position, CancellationToken cancellationToken)
ChangeSignature\CSharpChangeSignatureService.cs (1)
118var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\NodeSelectionHelpers.cs (1)
54var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (1)
59var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\AwaitCompletionProvider.cs (3)
128var tree = group.Key; 182protected override SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 198protected override SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\CompletionUtilities.cs (5)
44public static SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 252public static bool IsSpeculativeTypeParameterContext(SyntaxTree syntaxTree, int position, SemanticModel? semanticModel, bool includeStatementContexts, CancellationToken cancellationToken) 307static int WalkOutOfGenericType(SyntaxTree syntaxTree, int position, SemanticModel? semanticModel, CancellationToken cancellationToken) 336static int WalkOutOfRefType(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 349static int WalkOutOfTupleType(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
91var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (2)
36var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 106private static bool IsLambdaExpression(SemanticModel semanticModel, SyntaxTree tree, int position, SyntaxToken token, ITypeInferenceService typeInferrer, CancellationToken cancellationToken)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
67var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
65var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
68protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (2)
35SyntaxTree syntaxTree, 55var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
47var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\FileBasedPrograms\AbstractAppDirectiveCompletionProvider.cs (1)
46var tree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
51var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
61var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
56var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (3)
59var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 95var tree = semanticModel.SyntaxTree; 151protected override HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
41protected override SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
43protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken) 185public override SyntaxToken FindStartingToken(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (3)
64protected override SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken) 82protected override bool IsPartialMethodCompletionContext(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers, out SyntaxToken token) 102private static bool VerifyModifiers(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
54protected override SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (2)
46var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 170private static (PropertyPatternClauseSyntax?, ExpressionSyntax?, SubpatternSyntax? editingSubpattern) TryGetPropertyPatternClause(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\DirectiveCompletionProviderUtilities.cs (1)
12internal static bool TryGetStringLiteralToken(SyntaxTree tree, int position, SyntaxKind directiveKind, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\LoadDirectiveCompletionProvider.cs (1)
28protected override bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\Scripting\ReferenceDirectiveCompletionProvider.cs (1)
27protected override bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
102var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
65var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
75var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\CSharpCompletionService.cs (1)
73var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (1)
43var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
31var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
37var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
38var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (1)
47var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\FromKeywordRecommender.cs (1)
14var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\GlobalKeywordRecommender.cs (1)
16var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
17var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\LoadKeywordRecommender.cs (1)
15var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
17var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ObjectKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\OutKeywordRecommender.cs (1)
14var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ReferenceKeywordRecommender.cs (1)
15var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\RefKeywordRecommender.cs (2)
80var syntaxTree = context.SyntaxTree; 184private static bool IsValidNewByRefContext(SyntaxTree syntaxTree, int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
Completion\KeywordRecommenders\SByteKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ScopedKeywordRecommender.cs (1)
15var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
18var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UndefKeywordRecommender.cs (1)
15var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
66var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
25var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
39var syntaxTree = context.SyntaxTree;
Completion\Providers\ContextVariableArgumentProvider.cs (1)
28protected override bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
238var syntaxTree = grouping.Key; 368var syntaxTree = grouping.Key;
Debugging\BreakpointResolver.cs (1)
36var tree = location.SourceTree;
Debugging\CSharpBreakpointResolutionService.cs (1)
35var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Debugging\CSharpProximityExpressionsService.cs (2)
94var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 103public static IList<string> GetProximityExpressions(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
19internal sealed class Worker(SyntaxTree syntaxTree, int position) 21private readonly SyntaxTree _syntaxTree = syntaxTree;
Debugging\LocationInfoGetter.cs (1)
24var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\Analyzers\FileBasedPrograms\FileLevelDirectiveDiagnosticAnalyzer.cs (1)
40var tree = context.Tree;
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
32protected override MemberDeclarationSyntax? GetContainingMember(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 236SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 248SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
EditAndContinue\BreakpointSpans.cs (1)
19public static bool TryGetBreakpointSpan(SyntaxTree tree, int position, CancellationToken cancellationToken, out TextSpan breakpointSpan)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
570internal override bool ExperimentalFeaturesEnabled(SyntaxTree tree)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (1)
21public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (1)
32public override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\InstanceConstructorDeclarationBody.cs (1)
31public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
62public sealed override SyntaxTree SyntaxTree
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
28public override SyntaxTree SyntaxTree
FullyQualify\CSharpFullyQualifyService.cs (1)
51var syntaxTree = simpleName.SyntaxTree;
GenerateType\CSharpGenerateTypeService.cs (1)
188var syntaxTree = semanticModel.SyntaxTree;
LineSeparators\CSharpLineSeparatorService.cs (2)
38var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 326private static bool IsLegalSpanForLineSeparator(SyntaxTree syntaxTree, TextSpan textSpan, CancellationToken cancellationToken)
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
29var syntaxTree = (await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false))!;
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
103var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
NavigationBar\CSharpNavigationBarItemService.cs (2)
67var tree = semanticModel.SyntaxTree; 253Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
48var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
52var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Snippets\CSharpSnippetFunctionService.cs (2)
24var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 32var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\Analyzers\CodeStyle\CSharpAnalyzerOptionsProvider.cs (2)
99public static CSharpAnalyzerOptionsProvider GetCSharpAnalyzerOptions(this AnalyzerOptions options, SyntaxTree syntaxTree) 117public static CSharpAnalyzerOptionsProvider GetCSharpAnalyzerOptions(this SymbolStartAnalysisContext context, SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
34var syntaxTree = namespaceDeclaration.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
65var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
129var tree = context.SemanticModel.SyntaxTree; 174var tree = syntaxContext.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryAsyncModifier\CSharpMakeMethodSynchronousDiagnosticAnalyzer.cs (1)
45var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
54IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken) 71protected override void AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxTree tree, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
59var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (3)
179public static SyntaxTreeState Create(bool defaultCompleted, NullableContextOptions compilationOptions, SyntaxTree tree, CancellationToken cancellationToken) 259private readonly ConcurrentDictionary<SyntaxTree, SyntaxTreeState> _codeBlockIntervals = []; 316private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (3)
52var originalTree = semanticModel.SyntaxTree; 81var originalTree = semanticModel.SyntaxTree; 84var updatedTree = originalTree.WithRootAndOptions(
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\UnnecessaryUnsafeModifierUtilities.cs (3)
42var originalTree = semanticModel.SyntaxTree; 96var originalTree = semanticModel.SyntaxTree; 99var updatedTree = originalTree.WithRootAndOptions(
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
29protected override bool SupportsDiscard(SyntaxTree tree)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (3)
38var syntaxTree = semanticModel.SyntaxTree; 141var syntaxTree = semanticModel.SyntaxTree; 205SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, NotificationOption2 notification, ExpressionSyntax expression, bool changesSemantics)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
28var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
43var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
44var syntaxTree = semanticModel.SyntaxTree; 86var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
39var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
40var syntaxTree = context.SemanticModel.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
38var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (1)
39var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
58var syntaxTree = expression.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
81SyntaxTree? currentSyntaxTree = null; 100var fieldSyntaxTree = fieldSyntaxReference.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (3)
111var syntaxTree = document.SyntaxTree; 197var syntaxTree = document.SyntaxTree; 214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
45protected override async Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
42var syntaxTree = semanticDocument.SyntaxTree;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
45var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
533var syntaxTree = group.Key;
Structure\Providers\DisabledTextTriviaStructureProvider.cs (2)
25SyntaxTree syntaxTree, SyntaxTrivia trivia, 67private static int GetEndPositionExludingLastNewLine(SyntaxTree syntaxTree, SyntaxTrivia trivia, CancellationToken cancellationToken)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (2)
67var syntaxTree = semanticModel.SyntaxTree; 242var updatedSyntaxTree = semanticModel.SyntaxTree.WithRootAndOptions(
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Usage\CSharpMissingShebangInFileBasedProgram.cs (2)
37foreach (var tree in context.Compilation.SyntaxTrees) 80private static bool IsGeneratedCode(SyntaxTree tree, AnalyzerConfigOptionsProvider optionsProvider)
Microsoft.CodeAnalysis.CSharp.Scripting (3)
CSharpScriptCompiler.cs (3)
28public override bool IsCompleteSubmission(SyntaxTree tree) => SyntaxFactory.IsCompleteSubmission(tree); 30public override SyntaxTree ParseSubmission(SourceText text, ParseOptions parseOptions, CancellationToken cancellationToken) 47var tree = SyntaxFactory.ParseSyntaxTree(script.SourceText, script.Options.ParseOptions ?? DefaultParseOptions, script.Options.FilePath);
Microsoft.CodeAnalysis.CSharp.Workspaces (125)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
34var syntaxTree = semanticModel.SyntaxTree;
EmbeddedLanguages\CSharpTestEmbeddedLanguageUtilities.cs (1)
25var testFileTree = SyntaxFactory.ParseSyntaxTree(testFileSourceText, semanticModel.SyntaxTree.Options, cancellationToken: cancellationToken);
ExternalAccess\Pythia\Api\PythiaSyntaxExtensions.cs (2)
13public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 19public static SyntaxToken FindTokenOnLeftOfPosition(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool includeSkipped = true, bool includeDirectives = false, bool includeDocumentationComments = false)
Rename\CSharpRenameRewriterLanguageService.cs (1)
863var tree = location.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
15public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
246var syntaxTree = genericIdentifier.SyntaxTree!;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (29)
17public static ISet<SyntaxKind> GetPrecedingModifiers(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 21this SyntaxTree syntaxTree, 42this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 48this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 54this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 80this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 92public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, SyntaxToken targetToken, CancellationToken cancellationToken) 99public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 102public static bool IsRightOfDot(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken) 119public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 125public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken) 133public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 145public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 155public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 168public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 180this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 224this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 242this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 259this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 273this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 297this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 382this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 389public static bool IsEntirelyWithinStringLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 393this SyntaxTree syntaxTree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken) 442this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 470this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 532public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 540public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
154this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
128public bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132public bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken) 1013public TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1442public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
278var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
168var tree = semanticModel.SyntaxTree; 179var newTree = tree.WithRootAndOptions(newRoot, tree.Options);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (3)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options); 203var contextTree = contextLocation != null && contextLocation.IsInSource
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
187var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (64)
29public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 78this SyntaxTree syntaxTree, 138this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 240this SyntaxTree syntaxTree, 320this SyntaxTree syntaxTree, 336public static bool IsLocalFunctionDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 340this SyntaxTree syntaxTree, 369this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 529this SyntaxTree syntaxTree, 622this SyntaxTree syntaxTree, 676public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 693public static bool IsPartialTypeDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, [NotNullWhen(true)] out TypeDeclarationSyntax? declarationSyntax) 715public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 726this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 776public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 794public static bool IsUsingAliasTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 810public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 822this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 850this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 868public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 899public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 911public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 924this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 937this SyntaxTree syntaxTree, 962public static bool IsGenericConstraintContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 967this SyntaxTree syntaxTree, 1055this SyntaxTree syntaxTree, 1145this SyntaxTree syntaxTree, 1173this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1188this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1202public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1219public static bool IsPossibleExtensionMethodContext(this SyntaxTree syntaxTree, SyntaxToken tokenOnLeftOfPosition) 1231this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1263this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1290this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1315public static bool IsPossibleTupleContext(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1370public static bool IsAtStartOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1464public static bool IsAtEndOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1607public static bool IsPossibleDeconstructionDesignation(this SyntaxTree syntaxTree, 1717this SyntaxTree syntaxTree, 1757this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1774this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1888this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1905public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1922public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1934this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1952private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1959public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1966public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1984public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2007public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2038this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 2051public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2065public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, 2145public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2171this SyntaxTree syntaxTree, 2749public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2816this SyntaxTree syntaxTree, 2938this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2973public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2998public static bool IsBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3011public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3023public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 3078public static bool IsFunctionPointerCallingConventionContext(this SyntaxTree syntaxTree, SyntaxToken targetToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
14public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 22public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 32this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 38this SyntaxTree syntaxTree, 47this SyntaxTree syntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
28public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
196var syntaxTree = SemanticModel.SyntaxTree;
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (2)
58public override SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root) 64public override SyntaxTree ParseSyntaxTree(string filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.NodeSyntaxReference.cs (1)
21public override SyntaxTree SyntaxTree
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (2)
76public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 87public override SyntaxTree WithFilePath(string path)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
DocumentationComments\OmniSharpDocumentationCommentsSnippetService.cs (2)
18SyntaxTree syntaxTree, 30SyntaxTree syntaxTree,
Microsoft.CodeAnalysis.Features (165)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (3)
75var syntaxTree = constructor.SyntaxTree; 107var oldConstructorSyntaxTree = oldConstructor.SyntaxTree; 115var syntaxTree = oldConstructor.SyntaxTree;
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
48var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
BraceCompletion\AbstractBraceCompletionService.cs (1)
124var tree = context.Document.SyntaxTree;
ChangeSignature\AbstractChangeSignatureService.cs (1)
458var tree = location.SourceTree;
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
431var diagnosticSourceTree = _diagnostic?.Location.SourceTree;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
86var t = await document.GetSyntaxTreeAsync(c).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
263var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
69var currentTree = await currentDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
137var tree = removeSuppressionFixesForTree.Key;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
59public abstract SyntaxTree SyntaxTreeToModify { get; }
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
50public override SyntaxTree SyntaxTreeToModify => _attribute.ApplicationSyntaxReference.SyntaxTree;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
62public override SyntaxTree SyntaxTreeToModify => _suppressionTargetInfo.StartToken.SyntaxTree; 204var tree = model.SyntaxTree;
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
97var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractAwaitCompletionProvider.cs (5)
65protected abstract SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 66protected abstract SyntaxToken? GetDotTokenLeftOfPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 84var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 177var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 266var syntaxTree = syntaxContext.SyntaxTree;
Completion\Providers\AbstractContextVariableArgumentProvider.cs (2)
20protected abstract bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken); 85var tree = context.SemanticModel.SyntaxTree;
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
60var syntaxTree = await context.Document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractKeywordCompletionProvider.cs (1)
59var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
37protected abstract SyntaxToken GetToken(CompletionItem completionItem, SyntaxTree tree, CancellationToken cancellationToken); 72var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
23protected abstract SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
19protected abstract HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.BaseItemGetter.cs (2)
33protected readonly SyntaxTree SyntaxTree; 41SyntaxTree syntaxTree,
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
17public abstract SyntaxToken FindStartingToken(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
21SyntaxTree syntaxTree, 41var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (2)
32protected abstract bool IsPartialMethodCompletionContext(SyntaxTree tree, int position, CancellationToken cancellationToken, out DeclarationModifiers modifiers, out SyntaxToken token); 42var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (2)
35var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 77protected abstract SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
35var currentSyntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
215var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ImportCompletionProviderHelpers.cs (1)
25var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (2)
24protected abstract bool TryGetStringLiteralToken(SyntaxTree tree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken); 39var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
88var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
131var tree = textDocument is Document document
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (1)
116var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\Service\DocumentAnalysisExecutor.cs (1)
90var tree = document is null
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
83SyntaxTree? tree,
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (7)
21protected abstract TMemberNode? GetContainingMember(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 27protected abstract SyntaxToken GetTokenToRight(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 28protected abstract SyntaxToken GetTokenToLeft(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 78var syntaxTree = document.SyntaxTree; 188var syntaxTree = document.SyntaxTree; 263var syntaxTree = document.SyntaxTree; 355var syntaxTree = document.SyntaxTree;
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
316var tree = location.SourceTree;
DocumentSpanExtensions.cs (1)
35var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (22)
76internal abstract bool ExperimentalFeaturesEnabled(SyntaxTree tree); 550var oldTree = oldRoot.SyntaxTree; 551var newTree = newRoot.SyntaxTree; 756var tree = await oldDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 762var tree = await newDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 776private static async ValueTask<DocumentSemanticModel> GetDocumentSemanticModelAsync(Project project, Document? document, SyntaxTree tree, CancellationToken cancellationToken) 1511private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldStatement, SyntaxTree newTree, TextSpan newSpan, RudeEditDiagnosticsBuilder diagnostics, CancellationToken cancellationToken) 1761private ActiveStatementExceptionRegions GetExceptionRegions(List<SyntaxNode> exceptionHandlingAncestors, SyntaxTree tree, CancellationToken cancellationToken) 2222var oldTree = topMatch.OldRoot.SyntaxTree; 2223var newTree = topMatch.NewRoot.SyntaxTree; 2730var oldTree = editScript.Match.OldRoot.SyntaxTree; 2731var newTree = editScript.Match.NewRoot.SyntaxTree; 4169SyntaxTree oldTree, 4170SyntaxTree newTree, 5494SyntaxTree newTree, 5571var oldSyntaxTree = topMatch.OldRoot.SyntaxTree; 5572var newSyntaxTree = topMatch.NewRoot.SyntaxTree; 5805private static bool IsPartialTypeEdit(ISymbol? oldSymbol, ISymbol? newSymbol, SyntaxTree oldSyntaxTree, SyntaxTree newSyntaxTree) 5809static bool IsNotInDocument(SyntaxReference reference, SyntaxTree syntaxTree) 5812static bool IsPartialTypeEdit(ISymbol? symbol, SyntaxTree tree) 6417protected SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
EditAndContinue\AbstractSimpleMemberBody.cs (1)
19public sealed override SyntaxTree SyntaxTree
EditAndContinue\ActiveStatementsMap.cs (5)
45private ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>> _lazyOldDocumentActiveStatements; 56_lazyOldDocumentActiveStatements = ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>>.Empty; 168var oldTree = await oldDocument.DocumentState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 174internal ImmutableArray<UnmappedActiveStatement> GetOldActiveStatements(IEditAndContinueAnalyzer analyzer, SyntaxTree oldSyntaxTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken) 184private ImmutableArray<UnmappedActiveStatement> CalculateOldActiveStatementsAndExceptionRegions(IEditAndContinueAnalyzer analyzer, SyntaxTree oldTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken)
EditAndContinue\DebuggingSession.cs (1)
515var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
EditAndContinue\DeclarationBody.cs (1)
17public abstract SyntaxTree SyntaxTree { get; }
EditAndContinue\DocumentSemanticModel.cs (2)
18public readonly SyntaxTree SyntaxTree; 27public DocumentSemanticModel(Compilation compilation, SyntaxTree syntaxTree)
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (1)
125var newTree = await newDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
EditAndContinue\EditSession.cs (4)
194var newTree = await newDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 1037private static async ValueTask<ImmutableDictionary<SyntaxTree, SyntaxNode>> GetPartialTypeDeclarationTreeMapAsync( 1047var map = ImmutableDictionary.CreateBuilder<SyntaxTree, SyntaxNode>(); 1307var tree = (document != null) ? await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false) : null;
EditAndContinue\RudeEditDiagnostic.cs (1)
41internal Diagnostic ToDiagnostic(SyntaxTree? tree)
EditAndContinue\SemanticEditInfo.cs (2)
18public readonly SyntaxTree NewTree; 24SyntaxTree newTree,
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (1)
196SyntaxTree? tree = null;
FindUsages\AbstractFindUsagesService_FindReferences.cs (1)
175var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (1)
72var syntaxTree = await _document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
47var syntaxTree = semanticModel.SyntaxTree;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (1)
95var constructorTree = constructorSyntax.SyntaxTree;
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (2)
43var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 65var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GenerateFromMembers\GenerateFromMembersHelpers.cs (1)
27var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
60var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (1)
67var syntaxTree = semanticModel.SyntaxTree;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
196var syntaxTree = semanticModel.SyntaxTree; 235var groupSyntaxTree = group.Key;
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
899var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
120protected SemanticModel GetSemanticModel(SyntaxTree tree)
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
81var tree = await generatedDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan) 50Solution solution, ISymbol symbol, SyntaxTree tree, 91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
QuickInfo\CommonQuickInfoProvider.cs (2)
19var tree = await context.Document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 32protected async Task<ImmutableArray<SyntaxToken>> GetTokensAsync(SyntaxTree tree, int position, System.Threading.CancellationToken cancellationToken)
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
255var newTree = semanticModel.SyntaxTree.WithRootAndOptions(newRoot, semanticModel.SyntaxTree.Options);
Rename\SymbolicRenameInfo.cs (1)
126var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
361var syntaxTree = await updatedDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Shared\Utilities\AnnotatedSymbolMapping.cs (2)
54using var _1 = PooledDictionary<SyntaxTree, SyntaxNode>.GetInstance(out var currentRoots); 70var tree = location.SourceTree!;
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
308var syntaxTree = await relatedDocument.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
58var syntaxTree = context.SyntaxContext.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
109SyntaxTree tree, 117SyntaxTree tree, 147SyntaxTree tree,
src\roslyn\src\Analyzers\Core\Analyzers\AnalyzerOptionsProvider.cs (1)
87public static AnalyzerOptionsProvider GetAnalyzerOptions(this AnalyzerOptions analyzerOptions, SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
47var tree = context.Tree;
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (1)
98internal Location GetLocation(SyntaxTree syntaxTree)
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
46var tree = context.Tree;
src\roslyn\src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (2)
58var sourceTree = symbolContext.Symbol.Locations.FirstOrDefault()?.SourceTree; 112SyntaxTree sourceTree,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
64var tree = model.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
87var tree = context.SemanticModel.SyntaxTree; 93protected virtual void AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxTree tree, CancellationToken cancellationToken) 132var tree = compilation.SyntaxTrees.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken)); 199IEnumerable<TextSpan> contiguousSpans, SyntaxTree tree, 214IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 217IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
98var tree = semanticModel.SyntaxTree; 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 508SyntaxTree tree, 545SyntaxTree tree,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
772foreach (var tree in namedTypeSymbol.Locations.Select(l => l.SourceTree).Distinct().WhereNotNull()) 796var syntaxTree = group.Key;
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
109protected abstract bool SupportsDiscard(SyntaxTree tree); 199SyntaxTree syntaxTree,
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
149var tree = model.SyntaxTree; 208private readonly ConcurrentDictionary<SyntaxTree, (StrongBox<bool> completed, TextSpanMutableIntervalTree? intervalTree)> _codeBlockIntervals = [];
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\roslyn\src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
152var syntaxTree = context.Node.SyntaxTree;
src\roslyn\src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
16var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
19protected abstract Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
57var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
74var tree = await this.Document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
34var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
Structure\BlockStructureContext.cs (2)
12internal readonly struct BlockStructureContext(SyntaxTree syntaxTree, BlockStructureOptions options, CancellationToken cancellationToken) : IDisposable 20public readonly SyntaxTree SyntaxTree = syntaxTree;
Structure\BlockStructureServiceWithProviders.cs (2)
51var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 57SyntaxTree syntaxTree,
ValueTracking\SerializableValueTrackedItem.cs (1)
53var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTrackedItem.cs (1)
49var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Wrapping\Edit.cs (1)
77private readonly SyntaxTree? _tree = left.SyntaxTree;
Microsoft.CodeAnalysis.Razor.Compiler (1)
CSharp\DefaultUtf8WriteLiteralFeature.cs (1)
184var probeTree = CSharpSyntaxTree.ParseText(probeText, parseOptions);
Microsoft.CodeAnalysis.Rebuild (12)
CompilationFactory.cs (3)
43public abstract SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText); 52ImmutableArray<SyntaxTree> syntaxTrees, 69ImmutableArray<SyntaxTree> syntaxTrees,
CompilationOptionsReader.cs (5)
292public (ImmutableArray<SyntaxTree> SyntaxTrees, ImmutableArray<MetadataReference> MetadataReferences) ResolveArtifacts( 294Func<string, SourceText, SyntaxTree> createSyntaxTreeFunc) 300ImmutableArray<SyntaxTree> ResolveSyntaxTrees() 303var builder = ImmutableArray.CreateBuilder<SyntaxTree>(sourceFileCount); 320var syntaxTree = createSyntaxTreeFunc(sourceTextInfo.OriginalSourceFilePath, sourceText);
CSharpCompilationFactory.cs (2)
45public override SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText) 49ImmutableArray<SyntaxTree> syntaxTrees,
VisualBasicCompilationFactory.cs (2)
45public override SyntaxTree CreateSyntaxTree(string filePath, SourceText sourceText) 49ImmutableArray<SyntaxTree> syntaxTrees,
Microsoft.CodeAnalysis.ResxSourceGenerator (105)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>();
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
199foreach (var tree in compilation.SyntaxTrees)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
31public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 48public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (9)
31ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 34private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 36private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions) 67var perTreeOptionsBuilder = PooledDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance(); 68foreach (var tree in compilation.SyntaxTrees) 75static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider) 82public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 100public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 110private bool TryGetOptionValue<T, TArg>(string optionName, OptionKind kind, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, [MaybeNullWhen(false)] out T value)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (30)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 51=> TryGetSyntaxTreeForOption(symbol, out var tree) 58SyntaxTree tree, 69=> TryGetSyntaxTreeForOption(symbol, out var tree) 76SyntaxTree tree, 87=> TryGetSyntaxTreeForOption(symbol, out var tree) 94SyntaxTree tree, 102SyntaxTree tree, 109SyntaxTree tree, 120=> TryGetSyntaxTreeForOption(symbol, out var tree) 127SyntaxTree tree, 136SyntaxTree tree, 152SyntaxTree tree, 179SyntaxTree tree, 192=> TryGetSyntaxTreeForOption(symbol, out var tree) 200SyntaxTree tree, 212SyntaxTree tree, 224SyntaxTree tree, 240SyntaxTree tree, 247SyntaxTree tree, 300=> TryGetSyntaxTreeForOption(symbol, out var tree) 309=> TryGetSyntaxTreeForOption(symbol, out var tree) 324SyntaxTree? tree, 338SyntaxTree? tree, 387SyntaxTree? tree, 426SyntaxTree tree, 434SyntaxTree tree, 441SyntaxTree tree, 448SyntaxTree tree, 456SyntaxTree? tree,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\ICategorizedAnalyzerConfigOptions.cs (2)
51T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality); 53T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
Microsoft.CodeAnalysis.Scripting (3)
Hosting\CommandLine\CommandLineRunner.cs (1)
258var tree = _scriptCompiler.ParseSubmission(SourceText.From(input.ToString()), options.ParseOptions, cancellationToken);
ScriptCompiler.cs (2)
19public abstract SyntaxTree ParseSubmission(SourceText text, ParseOptions parseOptions, CancellationToken cancellationToken); 20public abstract bool IsCompleteSubmission(SyntaxTree tree);
Microsoft.CodeAnalysis.VisualBasic (314)
Binding\AttributeBinder.vb (1)
20Public Sub New(containingBinder As Binder, tree As SyntaxTree, Optional node As VisualBasicSyntaxNode = Nothing)
Binding\Binder.vb (3)
58Private ReadOnly _syntaxTree As SyntaxTree 78Protected Sub New(containingBinder As Binder, syntaxTree As SyntaxTree) 673Public ReadOnly Property SyntaxTree As SyntaxTree
Binding\Binder_Attributes.vb (1)
86Protected Function IsAttributeConditionallyOmitted(attributeType As NamedTypeSymbol, node As AttributeSyntax, syntaxTree As SyntaxTree) As Boolean
Binding\Binder_Delegates.vb (1)
446Dim syntaxTree As SyntaxTree
Binding\Binder_XmlLiterals.vb (1)
2001Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Binding\BinderBuilder.vb (11)
46tree As SyntaxTree) As Binder 64tree As SyntaxTree) As Binder 86tree As SyntaxTree) As Binder 152tree As SyntaxTree) As Binder 173tree As SyntaxTree, 228tree As SyntaxTree, 270tree As SyntaxTree, 304Public Shared Function CreateBinderForAttribute(tree As SyntaxTree, containingBinder As Binder, node As VisualBasicSyntaxNode) As AttributeBinder 309tree As SyntaxTree, 390tree As SyntaxTree, 414tree As SyntaxTree,
Binding\BinderFactory.vb (2)
22Private ReadOnly _tree As SyntaxTree 40Public Sub New(sourceModule As SourceModuleSymbol, tree As SyntaxTree, Optional binderFactoryVisitorPoolOpt As ObjectPool(Of BinderFactoryVisitor) = Nothing)
Binding\MemberSemanticModel.vb (1)
1189Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Binding\ProjectImportsBinder.vb (2)
28Private ReadOnly _tree As SyntaxTree 30Public Sub New(containingBinder As Binder, tree As SyntaxTree)
Binding\SourceFileBinder.vb (1)
29Public Sub New(containingBinder As Binder, sourceFile As SourceFile, tree As SyntaxTree)
BoundTree\BoundNode.vb (1)
98Public ReadOnly Property SyntaxTree As SyntaxTree
CodeGen\CodeGenerator.vb (1)
298Private Function EmitSequencePoint(tree As SyntaxTree, span As TextSpan) As TextSpan
CommandLine\VisualBasicCompiler.vb (3)
61errorLogger As ErrorLogger) As SyntaxTree 101Dim trees(sourceFiles.Length - 1) As SyntaxTree 269tree As SyntaxTree,
Compilation\ClsComplianceChecker.vb (3)
26Private ReadOnly _filterTree As SyntaxTree 40Private Sub New(compilation As VisualBasicCompilation, filterTree As SyntaxTree, filterSpanWithinTree As TextSpan?, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 72Public Shared Sub CheckCompliance(compilation As VisualBasicCompilation, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken, Optional filterTree As SyntaxTree = Nothing, Optional filterSpanWithinTree As TextSpan? = Nothing)
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (2)
403symbolName As String, symbol As Symbol, tree As SyntaxTree) 760tree As SyntaxTree,
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (4)
31Private ReadOnly _tree As SyntaxTree 32Private ReadOnly _onlyDiagnosticsFromTree As SyntaxTree 47onlyDiagnosticsFromTree As SyntaxTree, 156onlyDiagnosticsFromTree As SyntaxTree,
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (3)
27Private ReadOnly _filterSyntaxTree As SyntaxTree ' if not null, limit analysis to types residing in this tree 37filterTree As SyntaxTree, filterSpanWithinTree As TextSpan?, 66Optional filterTree As SyntaxTree = Nothing,
Compilation\DocumentationComments\DocumentationCommentWalker.vb (2)
32Private ReadOnly _syntaxTree As SyntaxTree 39syntaxTree As SyntaxTree,
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (1)
43Public Shared Sub ReportUnprocessed(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, diagnostics As DiagnosticBag, cancellationToken As CancellationToken)
Compilation\MethodCompiler.vb (2)
121Private Shared Function IsDefinedOrImplementedInSourceTree(symbol As Symbol, tree As SyntaxTree, span As TextSpan?) As Boolean 158tree As SyntaxTree,
Compilation\SemanticModel.vb (2)
2870Public MustOverride Shadows ReadOnly Property SyntaxTree As SyntaxTree 3062Protected NotOverridable Overrides ReadOnly Property SyntaxTreeCore As SyntaxTree
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
89Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (1)
69Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\SyntaxTreeSemanticModel.vb (3)
29Private ReadOnly _syntaxTree As SyntaxTree 36Friend Sub New(compilation As VisualBasicCompilation, sourceModule As SourceModuleSymbol, syntaxTree As SyntaxTree, ignoreAccessibility As Boolean) 65Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Compilation\VisualBasicCompilation.vb (87)
56Private Shared ReadOnly s_myTemplateCache As ConcurrentLruCache(Of VisualBasicParseOptions, SyntaxTree) = 57New ConcurrentLruCache(Of VisualBasicParseOptions, SyntaxTree)(capacity:=5) 90Private ReadOnly _syntaxTrees As ImmutableArray(Of SyntaxTree) 92Private ReadOnly _syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer) 98Private _lazyAllSyntaxTrees As ImmutableArray(Of SyntaxTree) 104Private ReadOnly _rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry) 107''' Imports appearing in <see cref="SyntaxTree"/>s in this compilation. 114Private _lazyImportClauseDependencies As ConcurrentDictionary(Of (SyntaxTree As SyntaxTree, ImportsClausePosition As Integer), ImmutableArray(Of AssemblySymbol)) 133Public ReadOnly Tree As Lazy(Of SyntaxTree) 136Public Sub New(treeOpt As Func(Of SyntaxTree), rootNamespaceOpt As Func(Of RootSingleNamespaceDeclaration)) 137Me.Tree = New Lazy(Of SyntaxTree)(treeOpt) 169Private _lazyMyTemplate As SyntaxTree = VisualBasicSyntaxTree.Dummy 181Private _lazyCompilationUnitCompletedTrees As HashSet(Of SyntaxTree) 242Friend Property MyTemplate As SyntaxTree 252Dim tree As SyntaxTree = Nothing 289Set(value As SyntaxTree) 328Optional syntaxTrees As IEnumerable(Of SyntaxTree) = Nothing, 334If(syntaxTrees IsNot Nothing, syntaxTrees.Cast(Of SyntaxTree), Nothing), 347Optional syntaxTree As SyntaxTree = Nothing, 360If((syntaxTree IsNot Nothing), {syntaxTree}, SpecializedCollections.EmptyEnumerable(Of SyntaxTree)()), 371syntaxTrees As IEnumerable(Of SyntaxTree), 388Dim declMap = ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)() 395ImmutableArray(Of SyntaxTree).Empty, 396ImmutableDictionary.Create(Of SyntaxTree, Integer)(), 422syntaxTrees As ImmutableArray(Of SyntaxTree), 423syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 424rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 442Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer(Of SyntaxTree).Default)) 488Private Function CommonLanguageVersion(syntaxTrees As ImmutableArray(Of SyntaxTree)) As LanguageVersion 528syntaxTrees As ImmutableArray(Of SyntaxTree), 529syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 530rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 638declMap = ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)() 880Public Shadows ReadOnly Property SyntaxTrees As ImmutableArray(Of SyntaxTree) 890Friend Shadows ReadOnly Property AllSyntaxTrees As ImmutableArray(Of SyntaxTree) 893Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 911Public Shadows Function ContainsSyntaxTree(syntaxTree As SyntaxTree) As Boolean 915Public Shadows Function AddSyntaxTrees(ParamArray trees As SyntaxTree()) As VisualBasicCompilation 916Return AddSyntaxTrees(DirectCast(trees, IEnumerable(Of SyntaxTree))) 919Public Shadows Function AddSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As VisualBasicCompilation 933Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 945For Each tree As SyntaxTree In trees 979tree As SyntaxTree, 982ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 993Private Shared Function ForTree(tree As SyntaxTree, options As VisualBasicCompilationOptions, isSubmission As Boolean) As RootSingleNamespaceDeclaration 997Public Shadows Function RemoveSyntaxTrees(ParamArray trees As SyntaxTree()) As VisualBasicCompilation 998Return RemoveSyntaxTrees(DirectCast(trees, IEnumerable(Of SyntaxTree))) 1001Public Shadows Function RemoveSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As VisualBasicCompilation 1011Dim removeSet As New HashSet(Of SyntaxTree)() 1015For Each tree As SyntaxTree In trees 1034Dim ordinalMap = ImmutableDictionary.Create(Of SyntaxTree, Integer)() 1035Dim builder = ArrayBuilder(Of SyntaxTree).GetInstance() 1050tree As SyntaxTree, 1051ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 1066Return UpdateSyntaxTrees(ImmutableArray(Of SyntaxTree).Empty, 1067ImmutableDictionary.Create(Of SyntaxTree, Integer)(), 1068ImmutableDictionary.Create(Of SyntaxTree, DeclarationTableEntry)(), 1073Public Shadows Function ReplaceSyntaxTree(oldTree As SyntaxTree, newTree As SyntaxTree) As VisualBasicCompilation 1271Friend Overrides Function GetSyntaxTreeOrdinal(tree As SyntaxTree) As Integer 1706Private Overloads Sub ReportUnusedImports(filterTree As SyntaxTree, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 1713Dim infoTree As SyntaxTree = info.Tree 1762Private Sub AddImportsDependencies(diagnostics As BindingDiagnosticBag, infoTree As SyntaxTree, clauseSpan As TextSpan) 1771Friend Overrides Sub CompleteTrees(filterTree As SyntaxTree) 1779For Each tree As SyntaxTree In SyntaxTrees 1786Private Sub CompleteTree(tree As SyntaxTree) 1796Interlocked.CompareExchange(_lazyCompilationUnitCompletedTrees, New HashSet(Of SyntaxTree)(), Nothing) 1822Friend Sub RecordImportsClauseDependencies(syntaxTree As SyntaxTree, importsClausePosition As Integer, dependencies As ImmutableArray(Of AssemblySymbol)) 1833Public ReadOnly Tree As SyntaxTree 2043Public Shadows Function GetSemanticModel(syntaxTree As SyntaxTree, Optional ignoreAccessibility As Boolean = False) As SemanticModel 2054Friend Overrides Function CreateSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel 2214Private Sub AddClsComplianceDiagnostics(diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken, Optional filterTree As SyntaxTree = Nothing, Optional filterSpanWithinTree As TextSpan? = Nothing) 2235Private Shared Iterator Function FilterDiagnosticsByLocation(diagnostics As IEnumerable(Of Diagnostic), tree As SyntaxTree, filterSpanWithinTree As TextSpan?) As IEnumerable(Of Diagnostic) 2244tree As SyntaxTree, 2302Private Sub GetDiagnosticsForMethodBodiesInTree(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, hasDeclarationErrors As Boolean, diagnostics As BindingDiagnosticBag, cancellationToken As CancellationToken) 2642tree As SyntaxTree, 2775Protected Overrides Function CommonGetSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel 2779Protected Overrides ReadOnly Property CommonSyntaxTrees As ImmutableArray(Of SyntaxTree) 2785Protected Overrides Function CommonAddSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2786Dim array = TryCast(trees, SyntaxTree()) 2795Return Me.AddSyntaxTrees(trees.Cast(Of SyntaxTree)()) 2798Protected Overrides Function CommonRemoveSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2799Dim array = TryCast(trees, SyntaxTree()) 2808Return Me.RemoveSyntaxTrees(trees.Cast(Of SyntaxTree)()) 2815Protected Overrides Function CommonReplaceSyntaxTree(oldTree As SyntaxTree, newTree As SyntaxTree) As Compilation 2823Protected Overrides Function CommonContainsSyntaxTree(syntaxTree As SyntaxTree) As Boolean
Declarations\DeclarationTreeBuilder.vb (3)
19Private ReadOnly _syntaxTree As SyntaxTree 27Public Shared Function ForTree(tree As SyntaxTree, rootNamespace As ImmutableArray(Of String), scriptClassName As String, isSubmission As Boolean) As RootSingleNamespaceDeclaration 33Private Sub New(syntaxTree As SyntaxTree, rootNamespace As ImmutableArray(Of String), scriptClassName As String, isSubmission As Boolean)
Locations\EmbeddedTreeLocation.vb (1)
37Friend Overrides ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree
Locations\LocationExtensions.vb (1)
33Public Function PossiblyEmbeddedOrMySourceTree(location As Location) As SyntaxTree
Locations\MyTemplateLocation.vb (3)
17Private ReadOnly _tree As SyntaxTree 31Friend Overrides ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree 37Public Sub New(tree As SyntaxTree, span As TextSpan)
Locations\VBLocation.vb (1)
30Friend Overridable ReadOnly Property PossiblyEmbeddedOrMySourceTree As SyntaxTree
Lowering\LambdaRewriter\LambdaFrameConstructor.vb (1)
66Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\LambdaRewriter\SynthesizedLambdaMethod.vb (1)
226Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (1)
318Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (1)
161Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Scanner\Blender.vb (1)
186baseTreeRoot As SyntaxTree,
SourceGeneration\VisualBasicGeneratorDriver.vb (1)
36Friend Overrides Function ParseGeneratedSourceText(input As GeneratedSourceText, fileName As String, cancellationToken As CancellationToken) As SyntaxTree
SymbolDisplay\SymbolDisplay.vb (2)
38''' <param name="position">A position within the <see cref="SyntaxTree"/> Or <paramref name="semanticModel"/>.</param> 89''' <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param>
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (1)
179Private Function GetSyntaxTree(semanticModel As SemanticModel) As SyntaxTree
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_PropertyPublicAccessors.vb (1)
39Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_ConstructorSymbol.vb (1)
56Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_EqualsMethodSymbol.vb (1)
99Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_GetHashCodeMethodSymbol.vb (1)
68Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_IEquatable_EqualsMethodSymbol.vb (1)
105Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_PropertyAccessors.vb (1)
58Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_ToStringMethodSymbol.vb (1)
73Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\EmbeddedSymbols\EmbeddedSymbolExtensions.vb (3)
18Public Function IsEmbeddedSyntaxTree(tree As SyntaxTree) As Boolean 23Public Function GetEmbeddedKind(tree As SyntaxTree) As EmbeddedSymbolKind 28Public Function IsEmbeddedOrMyTemplateTree(tree As SyntaxTree) As Boolean
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.vb (9)
18Private Shared s_embeddedSyntax As SyntaxTree = Nothing 19Private Shared s_vbCoreSyntax As SyntaxTree = Nothing 20Private Shared s_internalXmlHelperSyntax As SyntaxTree = Nothing 22Private Shared Function ParseResourceText(text As String) As SyntaxTree 26Friend Shared Function GetEmbeddedKind(tree As SyntaxTree) As EmbeddedSymbolKind 41Friend Shared Function GetEmbeddedTree(kind As EmbeddedSymbolKind) As SyntaxTree 54Public Shared ReadOnly Property EmbeddedSyntax As SyntaxTree 69Public Shared ReadOnly Property VbCoreSyntaxTree As SyntaxTree 81Public Shared ReadOnly Property InternalXmlHelperSyntax As SyntaxTree
Symbols\ErrorMethodSymbol.vb (1)
267Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\LexicalSortKey.vb (3)
84Private Sub New(embeddedKind As SyntaxTreeKind, tree As SyntaxTree, location As Integer, compilation As VisualBasicCompilation) 88Private Shared Function GetEmbeddedKind(tree As SyntaxTree) As SyntaxTreeKind 96Public Sub New(tree As SyntaxTree, position As Integer, compilation As VisualBasicCompilation)
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
1385Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\MethodSymbol.vb (4)
208Friend Overridable Function CallsAreOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 224Private Function CallsAreConditionallyOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 889Friend MustOverride Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer 1216Private Function IMethodSymbolInternal_CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer Implements IMethodSymbolInternal.CalculateLocalSyntaxOffset
Symbols\NamedTypeSymbolExtensions.vb (2)
24Friend Function FindMember(container As NamedTypeSymbol, symbolName As String, kind As SymbolKind, nameSpan As TextSpan, tree As SyntaxTree) As Symbol 55Friend Function FindFieldOrProperty(container As NamedTypeSymbol, symbolName As String, nameSpan As TextSpan, tree As SyntaxTree) As Symbol
Symbols\NamespaceSymbol.vb (1)
391Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\ReducedExtensionMethodSymbol.vb (1)
665Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
521Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SignatureOnlyMethodSymbol.vb (1)
326Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\LambdaSymbol.vb (1)
353Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceComplexParameterSymbol.vb (1)
201Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceEventSymbol.vb (1)
457Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceFieldSymbol.vb (2)
84Friend ReadOnly Property SyntaxTree As SyntaxTree 882tree As SyntaxTree,
Symbols\Source\SourceFile.vb (2)
19Private ReadOnly _syntaxTree As SyntaxTree 83Public Sub New(sourceModule As SourceModuleSymbol, tree As SyntaxTree)
Symbols\Source\SourceMemberContainerTypeSymbol.vb (3)
3242Friend Function CalculateSyntaxOffsetInSynthesizedConstructor(position As Integer, tree As SyntaxTree, isShared As Boolean) As Integer 3280Friend Function TryCalculateSyntaxOffsetOfPositionInInitializer(position As Integer, tree As SyntaxTree, isShared As Boolean, ByRef syntaxOffset As Integer) As Boolean 3306Private Shared Function GetInitializersInSourceTree(tree As SyntaxTree, initializers As ImmutableArray(Of ImmutableArray(Of FieldOrPropertyInitializer))) As ImmutableArray(Of FieldOrPropertyInitializer)
Symbols\Source\SourceMemberFieldSymbol.vb (1)
52Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\Source\SourceMethodSymbol.vb (6)
776Public ReadOnly Property SyntaxTree As SyntaxTree 804Friend NotOverridable Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 1049tree As SyntaxTree, 1156Dim syntaxTree As SyntaxTree = Nothing 1179Dim syntaxTree As SyntaxTree = Me.SyntaxTree 1203Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceModuleSymbol.vb (6)
68Private ReadOnly _sourceFileMap As New ConcurrentDictionary(Of SyntaxTree, SourceFile) 166Friend Function TryGetSourceFile(tree As SyntaxTree) As SourceFile 216Friend ReadOnly Property SyntaxTrees As IEnumerable(Of SyntaxTree) 584Friend Function GetDeclarationErrorsInTree(tree As SyntaxTree, 586locationFilter As Func(Of IEnumerable(Of Diagnostic), SyntaxTree, TextSpan?, IEnumerable(Of Diagnostic)), 660Dim trees = ArrayBuilder(Of SyntaxTree).GetInstance()
Symbols\Source\SourceNamedTypeSymbol.vb (5)
162Private Function CreateLocationSpecificBinderForType(tree As SyntaxTree, location As BindingLocation) As Binder 639Private Sub CheckDeclarationPart(tree As SyntaxTree, 822Private Sub CreateTypeParameterInfoInPart(tree As SyntaxTree, 1002Private Sub MakeDeclaredBaseInPart(tree As SyntaxTree, 1031Private Sub MakeDeclaredInterfacesInPart(tree As SyntaxTree,
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (1)
1396Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SourceNamespaceSymbol.vb (4)
310Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 354Friend Sub GenerateDeclarationErrorsInTree(tree As SyntaxTree, filterSpanWithinTree As TextSpan?, cancellationToken As CancellationToken) 365Private Sub ValidateDeclaration(tree As SyntaxTree, cancellationToken As CancellationToken) 526Friend Function GetDeclarationSpelling(tree As SyntaxTree, location As Integer) As String
Symbols\Source\SourcePropertySymbol.vb (2)
464Friend Overrides Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean 1223Friend ReadOnly Property SyntaxTree As SyntaxTree
Symbols\Source\SynthesizedConstructorSymbol.vb (1)
63Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedEntryPointSymbol.vb (1)
185Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedEventAccessorSymbol.vb (1)
514Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (1)
144Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
98Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
137Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (1)
129Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Source\SynthesizedWithEventsAccessorSymbol.vb (1)
110Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SubstitutedMethodSymbol.vb (2)
128Friend Overrides Function CallsAreOmitted(atNode As SyntaxNodeOrToken, syntaxTree As SyntaxTree) As Boolean 475Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Symbol.vb (2)
911Friend Overridable Function IsDefinedInSourceTree(tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean Implements ISymbolInternal.IsDefinedInSourceTree 931Friend Shared Function IsDefinedInSourceTree(syntaxNode As SyntaxNode, tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
453Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (1)
354Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionConstructorSymbol.vb (1)
60Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedInterfaceImplementationStubSymbol.vb (1)
210Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedIntrinsicOperatorSymbol.vb (1)
184Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedSimpleConstructorSymbol.vb (1)
67Friend NotOverridable Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\SynthesizedSymbols\SynthesizedSimpleMethodSymbol.vb (1)
113Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Symbols\Tuples\TupleMethodSymbol.vb (1)
127Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Syntax\SimpleSyntaxReference.vb (3)
15Private ReadOnly _tree As SyntaxTree 18Friend Sub New(tree As SyntaxTree, node As SyntaxNode) 23Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Syntax\SyntaxEquivalence.vb (2)
10Friend Function AreEquivalent(before As SyntaxTree, after As SyntaxTree, ignoreChildNode As Func(Of SyntaxKind, Boolean), topLevel As Boolean) As Boolean
Syntax\SyntaxExtensions.vb (1)
14Friend Function ReportDocumentationCommentDiagnostics(tree As SyntaxTree) As Boolean
Syntax\SyntaxFactory.vb (3)
943Public Shared Function AreEquivalent(oldTree As SyntaxTree, newTree As SyntaxTree, topLevel As Boolean) As Boolean 1062Friend Shared Function IsCompleteSubmission(tree As SyntaxTree) As Boolean
Syntax\SyntaxNodeFactories.vb (5)
35Optional encoding As Encoding = Nothing) As SyntaxTree 48cancellationToken As CancellationToken) As SyntaxTree 60cancellationToken As CancellationToken) As SyntaxTree 77Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 90Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree
Syntax\SyntaxTreeDiagnosticEnumerator.vb (2)
28Private ReadOnly _tree As SyntaxTree 34Friend Sub New(tree As SyntaxTree, node As InternalSyntax.VisualBasicSyntaxNode, position As Integer, inDocumentationComment As Boolean)
Syntax\VisualBasicLineDirectiveMap.vb (1)
17Public Sub New(tree As SyntaxTree)
Syntax\VisualBasicSyntaxNode.vb (10)
28Friend Sub New(green As GreenNode, position As Integer, syntaxTree As SyntaxTree) 47Friend Shadows ReadOnly Property SyntaxTree As SyntaxTree 51Dim tree As SyntaxTree = Nothing 77Dim alternativeTree As SyntaxTree = Interlocked.CompareExchange(stack.Pop()._syntaxTree, tree, Nothing) 184Friend Function GetSyntaxErrors(tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic) 188Friend Shared Function DoGetSyntaxErrors(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken) As ReadOnlyCollection(Of Diagnostic) 240Private Shared Sub ProcessTrivia(tree As SyntaxTree, 267Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken, errorInfo As DiagnosticInfo) As Diagnostic 274Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxTrivia, errorInfo As DiagnosticInfo) As Diagnostic 383Protected Overrides ReadOnly Property SyntaxTreeCore As SyntaxTree
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (4)
71Public Overrides Function WithChangedText(newText As SourceText) As SyntaxTree 90Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 94Public Overrides Function WithFilePath(path As String) As SyntaxTree 98Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (3)
114Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 131Public Overrides Function WithFilePath(path As String) As SyntaxTree 153Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (3)
139Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 156Public Overrides Function WithFilePath(path As String) As SyntaxTree 173Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.vb (19)
78''' Ensure that <see cref="SyntaxTree.HasCompilationUnitRoot"/> is true for this tree prior to invoking this method. 80''' <exception cref="InvalidCastException">Throws this exception if <see cref="SyntaxTree.HasCompilationUnitRoot"/> is false.</exception> 101Public Overrides Function WithChangedText(newText As SourceText) As SyntaxTree 115Private Function WithChanges(newText As SourceText, changes As TextChangeRange()) As SyntaxTree 167Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing) As SyntaxTree 187checksumAlgorithm As SourceHashAlgorithm) As SyntaxTree 203Friend Shared Function CreateForDebugger(root As VisualBasicSyntaxNode, text As SourceText, options As VisualBasicParseOptions) As SyntaxTree 216Friend Shared Function CreateWithoutClone(root As VisualBasicSyntaxNode, options As VisualBasicParseOptions) As SyntaxTree 233Optional path As String = "") As SyntaxTree 243Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 253Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 270Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 286Optional cancellationToken As CancellationToken = Nothing) As SyntaxTree 512Public Overrides Function IsEquivalentTo(tree As SyntaxTree, Optional topLevel As Boolean = False) As Boolean 522Public Overrides Function GetChangedSpans(oldTree As SyntaxTree) As IList(Of TextSpan) 535Public Overrides Function GetChanges(oldTree As SyntaxTree) As IList(Of TextChange) 618cancellationToken As CancellationToken) As SyntaxTree 629cancellationToken As CancellationToken) As SyntaxTree 638encoding As Encoding) As SyntaxTree
Syntax\VisualBasicWarningStateMap.vb (3)
13Public Sub New(tree As SyntaxTree) 17Protected Overrides Function CreateWarningStateMapEntries(syntaxTree As SyntaxTree) As WarningStateMapEntry() 27Private Shared Sub GetAllWarningDirectives(syntaxTree As SyntaxTree, directiveList As ArrayBuilder(Of DirectiveTriviaSyntax))
VisualBasicExtensions.vb (8)
236Friend Function IsMyTemplate(syntaxTree As SyntaxTree) As Boolean 242Friend Function HasReferenceDirectives(syntaxTree As SyntaxTree) As Boolean 248Friend Function IsAnyPreprocessorSymbolDefined(syntaxTree As SyntaxTree, conditionalSymbolNames As IEnumerable(Of String), atNode As SyntaxNodeOrToken) As Boolean 259Friend Function GetVisualBasicRoot(syntaxTree As SyntaxTree, Optional cancellationToken As CancellationToken = Nothing) As VisualBasicSyntaxNode 264Friend Function GetPreprocessingSymbolInfo(syntaxTree As SyntaxTree, identifierNode As IdentifierNameSyntax) As VisualBasicPreprocessingSymbolInfo 280Friend Function GetSyntaxErrors(token As SyntaxToken, tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic) 504Public Function GetCompilationUnitRoot(tree As SyntaxTree) As CompilationUnitSyntax 512Friend Function GetWarningState(tree As SyntaxTree, id As String, position As Integer) As ReportDiagnostic
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (24)
src\roslyn\src\Analyzers\VisualBasic\Analyzers\CodeStyle\VisualBasicAnalyzerOptionsProvider.vb (1)
74Public Function GetVisualBasicAnalyzerOptions(options As AnalyzerOptions, syntaxTree As SyntaxTree) As VisualBasicAnalyzerOptionsProvider
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
56nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan)
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
35Protected Overrides Function SupportsDiscard(tree As SyntaxTree) As Boolean
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
38Public Function GetStartDirectives(syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of DirectiveTriviaSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
638Public Function ReplaceStatements(tree As SyntaxTree, 714tree As SyntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (14)
121Public Function FindTriviaToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxTrivia 152Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 161Public Function IsWithinPartialMethodDeclaration(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 177Public Function IsEntirelyWithinComment(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 188Public Function IsEntirelyWithinStringLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 199Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 238Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 265Public Function IsInSkippedText(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 296Public Function IsGlobalStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 313Public Function IsRightOfDot(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 324Public Function IsRightOfIntegerLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 330Public Function IsInPreprocessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 336syntaxTree As SyntaxTree, 357Public Function GetFirstStatementOnLine(syntaxTree As SyntaxTree, lineNumber As Integer, cancellationToken As CancellationToken) As StatementSyntax
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (4)
128Public Function IsPreProcessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsPreProcessorDirectiveContext 132Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral 1084Public Function GetInactiveRegionSpanAroundPosition(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TextSpan Implements ISyntaxFacts.GetInactiveRegionSpanAroundPosition 1679Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (45)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
44Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of (SyntaxTree As SyntaxTree, root As SyntaxNode)?)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (37)
14Friend Function GetTargetToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 38Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 47Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, preProcessorTokenOnLeftOfPosition As SyntaxToken, cancellationToken As CancellationToken) As Boolean 63Public Function IsNamespaceContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 68Public Function IsNamespaceDeclarationNameContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 82Public Function IsPartialTypeDeclarationNameContext(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, ByRef statementSyntax As TypeStatementSyntax) As Boolean 106Public Function GetContainingTypeBlock(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TypeBlockSyntax 115Friend Function IsTypeDeclarationContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 122syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, allowAfterModifiersOrDim As Boolean, cancellationToken As CancellationToken, ParamArray allowedParentBlocks As SyntaxKind()) As Boolean 188Friend Function IsTypeMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 197Friend Function IsInterfaceMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 205Friend Function IsTypeDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 212Friend Function IsFieldNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 245Friend Function IsParameterNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 268Friend Function IsLabelContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 301Friend Function IsEnumMemberNameContext(syntaxTree As SyntaxTree, context As VisualBasicSyntaxContext) As Boolean 315Public Function IsDelegateCreationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 339syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 346syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 459Public Function IsAttributeNameContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 479Public Function IsTypeContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 545Private Sub PositionOutsideTupleIfApplicable(syntaxTree As SyntaxTree, ByRef position As Integer, 556Public Function IsNameOfContext(syntaxTree As SyntaxTree, position As Integer, Optional cancellationToken As CancellationToken = Nothing) As Boolean 572Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 582Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 625Friend Function IsMultiLineStatementStartContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 662Friend Function IsStartOfSelectCaseBlock(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 670Friend Function IsAfterStatementOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 684Friend Function IsInStatementBlockOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 716Public Function IsQueryIntoClauseContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 750Public Function IsRaiseEventContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 756Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 762Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 775Friend Function IsEnumTypeMemberAccessContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 811syntaxTree As SyntaxTree, 1072Friend Function IsPossibleTupleContext(syntaxTree As SyntaxTree, 1089Public Function IsInPreprocessorExpressionContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
367Return SyntaxTree.IsFollowingCompleteExpression( 387Return SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
57Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (2)
22Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInNonUserCode 38Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (2)
32Public Sub New(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) 302Private Shared Function ComputeAllowableDeclarationTypes(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As PossibleDeclarationTypes
Microsoft.CodeAnalysis.VisualBasic.Features (29)
Completion\CompletionProviders\AwaitCompletionProvider.vb (2)
65Protected Overrides Function GetExpressionToPlaceAwaitInFrontOf(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode 83Protected Overrides Function GetDotTokenLeftOfPosition(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken?
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (1)
39Protected Overrides Function GetObjectCreationNewExpression(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
28Protected Overrides Function GetInitializedMembers(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As HashSet(Of String)
Completion\CompletionProviders\OverrideCompletionProvider.vb (2)
54Protected Overrides Function GetToken(completionItem As CompletionItem, syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As SyntaxToken 59Public Overrides Function FindStartingToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
56Protected Overrides Function GetPartialTypeSyntaxNode(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\KeywordRecommenders\PreprocessorDirectives\PreprocessorHelpers.vb (2)
12Public Function GetInnermostIfPreprocessorKind(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxKind? 28Public Sub New(syntaxTree As SyntaxTree, maxPosition As Integer, cancellationToken As CancellationToken)
Completion\Providers\ContextVariableArgumentProvider.vb (1)
29Protected Overrides Function IsInstanceContext(syntaxTree As SyntaxTree, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean
Debugging\ProximityExpressionsGetter.vb (2)
34Friend Shared Function [Do](syntaxTree As SyntaxTree, 39Private Shared Function [Do](syntaxTree As SyntaxTree,
Debugging\ProximityExpressionsGetter.Worker.vb (2)
14Private ReadOnly _syntaxTree As SyntaxTree 21Public Sub New(syntaxTree As SyntaxTree, position As Integer)
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (3)
26Protected Overrides Function GetContainingMember(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As DeclarationStatementSyntax 244Protected Overrides Function GetTokenToRight(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 253Protected Overrides Function GetTokenToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken
EditAndContinue\BreakpointSpans.vb (1)
13Friend Function TryGetBreakpointSpan(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, <Out> ByRef breakpointSpan As TextSpan) As Boolean
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (1)
46Public NotOverridable Overrides ReadOnly Property SyntaxTree As SyntaxTree
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (1)
23Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
286Friend Overrides Function ExperimentalFeaturesEnabled(tree As SyntaxTree) As Boolean
NavigationBar\VisualBasicNavigationBarItemService.vb (4)
157tree As SyntaxTree, 183tree As SyntaxTree, 202tree As SyntaxTree, 392tree As SyntaxTree,
src\roslyn\src\Analyzers\VisualBasic\Analyzers\CodeStyle\VisualBasicAnalyzerOptionsProvider.vb (1)
74Public Function GetVisualBasicAnalyzerOptions(options As AnalyzerOptions, syntaxTree As SyntaxTree) As VisualBasicAnalyzerOptionsProvider
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
56nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan)
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
35Protected Overrides Function SupportsDiscard(tree As SyntaxTree) As Boolean
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
44Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of (SyntaxTree As SyntaxTree, root As SyntaxNode)?)
Microsoft.CodeAnalysis.VisualBasic.Scripting (2)
VisualBasicScriptCompiler.vb (2)
36Public Overrides Function IsCompleteSubmission(tree As SyntaxTree) As Boolean 40Public Overrides Function ParseSubmission(text As SourceText, parseOptions As ParseOptions, cancellationToken As CancellationToken) As SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Workspaces (70)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (1)
38Public Function GetStartDirectives(syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of DirectiveTriviaSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
638Public Function ReplaceStatements(tree As SyntaxTree, 714tree As SyntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (14)
121Public Function FindTriviaToLeft(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxTrivia 152Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 161Public Function IsWithinPartialMethodDeclaration(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 177Public Function IsEntirelyWithinComment(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 188Public Function IsEntirelyWithinStringLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 199Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 238Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 265Public Function IsInSkippedText(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 296Public Function IsGlobalStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 313Public Function IsRightOfDot(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 324Public Function IsRightOfIntegerLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 330Public Function IsInPreprocessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 336syntaxTree As SyntaxTree, 357Public Function GetFirstStatementOnLine(syntaxTree As SyntaxTree, lineNumber As Integer, cancellationToken As CancellationToken) As StatementSyntax
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (4)
128Public Function IsPreProcessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsPreProcessorDirectiveContext 132Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral 1084Public Function GetInactiveRegionSpanAroundPosition(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TextSpan Implements ISyntaxFacts.GetInactiveRegionSpanAroundPosition 1679Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (37)
14Friend Function GetTargetToken(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxToken 38Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 47Public Function IsPreProcessorKeywordContext(syntaxTree As SyntaxTree, position As Integer, preProcessorTokenOnLeftOfPosition As SyntaxToken, cancellationToken As CancellationToken) As Boolean 63Public Function IsNamespaceContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 68Public Function IsNamespaceDeclarationNameContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 82Public Function IsPartialTypeDeclarationNameContext(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, ByRef statementSyntax As TypeStatementSyntax) As Boolean 106Public Function GetContainingTypeBlock(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TypeBlockSyntax 115Friend Function IsTypeDeclarationContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 122syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, allowAfterModifiersOrDim As Boolean, cancellationToken As CancellationToken, ParamArray allowedParentBlocks As SyntaxKind()) As Boolean 188Friend Function IsTypeMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 197Friend Function IsInterfaceMemberDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 205Friend Function IsTypeDeclarationKeywordContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 212Friend Function IsFieldNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 245Friend Function IsParameterNameDeclarationContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 268Friend Function IsLabelContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 301Friend Function IsEnumMemberNameContext(syntaxTree As SyntaxTree, context As VisualBasicSyntaxContext) As Boolean 315Public Function IsDelegateCreationContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 339syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 346syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 459Public Function IsAttributeNameContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 479Public Function IsTypeContext(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken, Optional semanticModelOpt As SemanticModel = Nothing) As Boolean 545Private Sub PositionOutsideTupleIfApplicable(syntaxTree As SyntaxTree, ByRef position As Integer, 556Public Function IsNameOfContext(syntaxTree As SyntaxTree, position As Integer, Optional cancellationToken As CancellationToken = Nothing) As Boolean 572Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 582Friend Function IsSingleLineStatementContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 625Friend Function IsMultiLineStatementStartContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 662Friend Function IsStartOfSelectCaseBlock(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As Boolean 670Friend Function IsAfterStatementOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 684Friend Function IsInStatementBlockOfKind(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken, ParamArray kinds As SyntaxKind()) As Boolean 716Public Function IsQueryIntoClauseContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 750Public Function IsRaiseEventContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 756Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean 762Public Function IsObjectCreationTypeContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, cancellationToken As CancellationToken) As Boolean 775Friend Function IsEnumTypeMemberAccessContext(syntaxTree As SyntaxTree, position As Integer, targetToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Boolean 811syntaxTree As SyntaxTree, 1072Friend Function IsPossibleTupleContext(syntaxTree As SyntaxTree, 1089Public Function IsInPreprocessorExpressionContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
367Return SyntaxTree.IsFollowingCompleteExpression( 387Return SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (1)
57Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (2)
22Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInNonUserCode 38Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (2)
32Public Sub New(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) 302Private Shared Function ComputeAllowableDeclarationTypes(syntaxTree As SyntaxTree, position As Integer, token As SyntaxToken, cancellationToken As CancellationToken) As PossibleDeclarationTypes
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.NodeSyntaxReference.vb (1)
18Public Overrides ReadOnly Property SyntaxTree As SyntaxTree
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (2)
76Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 88Public Overrides Function WithFilePath(path As String) As SyntaxTree
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.vb (2)
64Public Overrides Function ParseSyntaxTree(filePath As String, options As ParseOptions, text As SourceText, cancellationToken As CancellationToken) As SyntaxTree 72Public Overrides Function CreateSyntaxTree(filePath As String, options As ParseOptions, text As SourceText, encoding As Encoding, checksumAlgorithm As SourceHashAlgorithm, root As SyntaxNode) As SyntaxTree
Microsoft.CodeAnalysis.Workspaces (192)
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
45/// will only be examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No
CodeFixes\FixAllOccurrences\FixAllProvider.cs (2)
51/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects 65/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects
CodeRefactorings\FixAllOccurences\DocumentBasedRefactorAllProvider.cs (1)
48/// it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects of document (like it's properties),
CodeRefactorings\FixAllOccurences\RefactorAllProvider.cs (2)
51/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects 64/// examined for its content (e.g. it's <see cref="SyntaxTree"/> or <see cref="SourceText"/>. No other aspects
Diagnostics\DiagnosticAnalysisResultBuilder.cs (5)
108public void AddSyntaxDiagnostics(SyntaxTree tree, ImmutableArray<Diagnostic> diagnostics) 114public void AddSemanticDiagnostics(SyntaxTree tree, ImmutableArray<Diagnostic> diagnostics) 127ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 150var diagnosticTree = diagnostic.Location.SourceTree; 180ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, ImmutableArray<Diagnostic> diagnostics)
Diagnostics\DiagnosticDataLocation.cs (1)
104public DiagnosticDataLocation WithSpan(TextSpan newSourceSpan, SyntaxTree tree)
Diagnostics\DocumentDiagnosticAnalyzer.cs (2)
19public virtual async Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(TextDocument textDocument, SyntaxTree? tree, CancellationToken cancellationToken) 22public virtual async Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(TextDocument textDocument, SyntaxTree? tree, CancellationToken cancellationToken)
Diagnostics\Extensions.cs (4)
54var tree = textDocument is Document { SupportsSyntaxTree: true } document 114SyntaxTree? treeToAnalyze = null; 249SyntaxTree? tree, 265SyntaxTree? tree,
Diagnostics\FileContentLoadAnalyzer.cs (1)
29TextDocument textDocument, SyntaxTree? tree, CancellationToken cancellationToken)
Diagnostics\GeneratorDiagnosticsPlaceholderAnalyzer.cs (1)
28public override async Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(TextDocument textDocument, SyntaxTree? tree, CancellationToken cancellationToken)
Editing\SymbolEditor.cs (3)
210/// An action that make changes to a declaration node within a <see cref="SyntaxTree"/>. 217/// An action that make changes to a declaration node within a <see cref="SyntaxTree"/>. 324var sourceTree = location.SourceTree;
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
27public SyntaxTree SyntaxTree => this.SemanticModel.SyntaxTree;
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
124var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolFinder.cs (1)
116var syntaxTree = semanticModel.SyntaxTree;
ReassignedVariable\AbstractReassignedVariableService.cs (2)
50using var _3 = PooledDictionary<SyntaxTree, SemanticModel>.GetInstance(out var syntaxTreeToModel); 90SemanticModel GetSemanticModel(SyntaxTree syntaxTree)
Remote\RemoteArguments.cs (1)
176var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
357var baseSyntaxTree = await baseDocument.GetRequiredSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false); 448var baseSyntaxTree = await baseDocument.GetRequiredSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false);
Rename\IRemoteRenamerService.cs (1)
93var tree = await document.GetRequiredSyntaxTreeAsync(cancellation).ConfigureAwait(false);
Rename\RenameRewriterParameters.cs (1)
38internal readonly SyntaxTree OriginalSyntaxTree = semanticModel.SyntaxTree;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
417SyntaxTree tree,
Shared\Extensions\ProjectExtensions.cs (1)
37public static Document GetRequiredDocument(this Project project, SyntaxTree tree)
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (1)
63CompilerLoadContext = compilerLoadContext ?? AssemblyLoadContext.GetLoadContext(typeof(SyntaxTree).GetTypeInfo().Assembly)!;
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
241var destinationTree = destinationDeclaration.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
78var syntaxTree = destination.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
50public SyntaxTree SyntaxTree { get; } = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (4)
57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 59if (document.TryGetSyntaxTree(out var syntaxTree)) 67public static SyntaxTree GetRequiredSyntaxTreeSynchronously(this Document document, CancellationToken cancellationToken) 69var syntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (3)
19var syntaxTree = document.GetSyntaxTreeSynchronously(cancellationToken); 26var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
15bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 18Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
51var previousSyntaxTree = previousSemanticModel.SyntaxTree; 52var currentSyntaxTree = currentBodyNode.SyntaxTree; 178private readonly SyntaxTree _originalSyntaxTree; 179private readonly SyntaxTree _updatedSyntaxTree; 182public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Workspace\Host\SyntaxTreeFactory\AbstractSyntaxTreeFactoryService.cs (2)
20public abstract SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root); 21public abstract SyntaxTree ParseSyntaxTree(string filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken);
Workspace\Host\SyntaxTreeFactory\ISyntaxTreeFactoryService.cs (2)
30SyntaxTree CreateSyntaxTree(string? filePath, ParseOptions options, SourceText? text, Encoding? encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root); 33SyntaxTree ParseSyntaxTree(string? filePath, ParseOptions options, SourceText text, CancellationToken cancellationToken);
Workspace\IWorkspaceConfigurationService.cs (1)
27/// cref="Document"/>, <see cref="SyntaxTree"/>, etc.) to which it would be impractical to flow these options
Workspace\Solution\Document.cs (15)
43private Task<SyntaxTree>? _syntaxTreeResultTask; 78public bool TryGetSyntaxTree([NotNullWhen(returnValue: true)] out SyntaxTree? syntaxTree) 159/// Gets the <see cref="SyntaxTree" /> for this document asynchronously. 164/// a cached result every subsequent time. <see cref="SyntaxTree"/>'s can hold onto their roots lazily. So calls 165/// to <see cref="SyntaxTree.GetRoot"/> or <see cref="SyntaxTree.GetRootAsync"/> may end up causing computation 168public async Task<SyntaxTree?> GetSyntaxTreeAsync(CancellationToken cancellationToken = default) 183if (TryGetSyntaxTree(out var tree)) 197internal SyntaxTree? GetSyntaxTreeSynchronously(CancellationToken cancellationToken) 215return this.TryGetSyntaxTree(out var tree) && tree.TryGetRoot(out root) && root != null; 233var tree = (await this.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false))!; 249var tree = this.GetSyntaxTreeSynchronously(cancellationToken)!; 350var syntaxTree = await this.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 496var tree = useAsync ? await GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false) : this.GetSyntaxTreeSynchronously(cancellationToken); 497var oldTree = useAsync ? await oldDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false) : oldDocument.GetSyntaxTreeSynchronously(cancellationToken);
Workspace\Solution\DocumentState.cs (19)
26private static readonly ConditionalWeakTable<SyntaxTree, DocumentId> s_syntaxTreeToIdMap = new(); 170var tree = treeFactory.ParseSyntaxTree(filePath, options, text, cancellationToken); 240var oldTree = oldTreeAndVersion.Tree; 243var newTree = oldTree.WithChangedText(newText); 250private static TreeAndVersion MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion) 259private static bool TopLevelChanged(SyntaxTree oldTree, SourceText oldText, SyntaxTree newTree, SourceText newText) 351var existingTree = existingTreeAndVersion.Tree; 353SyntaxTree? newTree = null; 502if (TryGetSyntaxTree(out var priorTree)) 538var tree = factory.CreateSyntaxTree(attributes.SyntaxTreeFilePath, options, text: null, encoding, checksumAlgorithm, newRoot); 584public bool TryGetSyntaxTree([NotNullWhen(returnValue: true)] out SyntaxTree? syntaxTree) 598public async ValueTask<SyntaxTree> GetSyntaxTreeAsync(CancellationToken cancellationToken) 610internal SyntaxTree GetSyntaxTree(CancellationToken cancellationToken) 652private static void BindSyntaxTreeToId(SyntaxTree tree, DocumentId id) 664public static DocumentId? GetDocumentIdForTree(SyntaxTree tree) 671SyntaxTree newTree, 673SyntaxTree? oldTree = null,
Workspace\Solution\DocumentState_LinkedFileReuse.cs (4)
137var siblingTree = siblingRoot.SyntaxTree; 155var newTree = treeFactory.CreateSyntaxTree( 245var siblingTree = siblingTreeAndVersion.Tree; 268var siblingTree = siblingTreeAndVersion.Tree;
Workspace\Solution\Project.cs (2)
231public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) 237public Document? GetDocument(SyntaxTree? syntaxTree)
Workspace\Solution\ProjectState.cs (4)
420public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) 466public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) 561public override GeneratedKind IsGenerated(SyntaxTree tree, CancellationToken cancellationToken) 568public override bool TryGetDiagnosticValue(SyntaxTree tree, string diagnosticId, CancellationToken cancellationToken, out ReportDiagnostic severity)
Workspace\Solution\Solution.cs (4)
236public DocumentId? GetDocumentId(SyntaxTree? syntaxTree) => GetDocumentId(syntaxTree, projectId: null); 241public DocumentId? GetDocumentId(SyntaxTree? syntaxTree, ProjectId? projectId) 323public Document? GetDocument(SyntaxTree? syntaxTree) 326internal Document? GetDocument(SyntaxTree? syntaxTree, ProjectId? projectId)
Workspace\Solution\SolutionCompilationState.cs (2)
1018oldDocumentState.TryGetSyntaxTree(out var oldTree) && oldTree.TryGetRoot(out var oldRoot) && oldRoot == root 1282/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (6)
803using var _ = ArrayBuilder<SyntaxTree>.GetInstance(documentsWithTrees.Length, out var alreadyParsedTrees); 806if (documentState.TryGetSyntaxTree(out var alreadyParsedTree)) 972var syntaxTreesInWorkspaceStates = new HashSet<SyntaxTree>( 980ThrowExceptionIfFalse(documentInProjectState.Value.TryGetSyntaxTree(out var tree), "We should have a tree since we have a compilation that should contain it."); 989ThrowExceptionIfFalse(generatedDocument.Value.TryGetSyntaxTree(out var tree), "We should have a tree since we have a compilation that should contain it."); 996foreach (var tree in compilation.SyntaxTrees)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
288using var _ = ArrayBuilder<SyntaxTree>.GetInstance(out var treesToRemove);
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (4)
16internal DocumentState? GetDocumentState(SyntaxTree? syntaxTree, ProjectId? projectId) 32if (document.TryGetSyntaxTree(out var documentTree) && documentTree == syntaxTree) 44if (generatedDocument.TryGetSyntaxTree(out var documentTree) && documentTree == syntaxTree) 82var syntaxTree = symbol.Locations[0].SourceTree;
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (3)
142using var _ = ArrayBuilder<SyntaxTree>.GetInstance(documents.Length, out var syntaxTrees); 182var documentsAndTrees = await ProducerConsumer<(DocumentState document, SyntaxTree tree)>.RunParallelAsync( 209using var _ = ArrayBuilder<SyntaxTree>.GetInstance(this.NewProjectState.DocumentStates.Count, out var syntaxTrees);
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (2)
129var replacementSyntaxTree = await replacementState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 135var existingSyntaxTree = await existingState.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\SourceGeneratedDocumentState.cs (3)
107var newTree = factory.CreateSyntaxTree(documentIdentity.FilePath, parseOptions, generatedSourceText, generatedSourceText.Encoding, generatedSourceText.ChecksumAlgorithm, syntaxNode); 230if (this.TryGetSyntaxTree(out var tree) && 239var newTree = factory.CreateSyntaxTree(Attributes.SyntaxTreeFilePath, ParseOptions, sourceText, sourceText.Encoding, sourceText.ChecksumAlgorithm, newRoot);
Workspace\Solution\TreeAndVersion.cs (2)
10internal sealed class TreeAndVersion(SyntaxTree tree, VersionStamp version) 15public SyntaxTree Tree { get; } = tree;
Microsoft.DotNet.ApiSymbolExtensions (1)
AssemblySymbolLoader.cs (1)
281List<SyntaxTree> syntaxTrees = [];
Microsoft.DotNet.GenFacades (9)
NotSupportedAssemblyGenerator.cs (1)
69SyntaxTree syntaxTree;
TypeParser.cs (8)
28foreach (var tree in syntaxTreeCollection) 37private static void AddTypesFromTypeForwards(SyntaxTree tree, HashSet<string> types) 56private static void AddBaseTypes(SyntaxTree tree, HashSet<string> types) 70private static void AddTypesFromDelegates(SyntaxTree tree, HashSet<string> types) 133private static IEnumerable<SyntaxTree> GetSourceTrees(IEnumerable<string> sourceFiles, IEnumerable<string> constants, LanguageVersion languageVersion) 136List<SyntaxTree> result = new List<SyntaxTree>(); 147SyntaxTree tree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile), options);
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
73foreach (IGrouping<SyntaxTree, ClassDeclarationSyntax> group in classes.GroupBy(x => x.SyntaxTree)) 75SyntaxTree syntaxTree = group.Key;
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
GeneratorTests.cs (1)
138public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => _globalOptions;
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
203public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => throw new System.NotSupportedException();
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
EmitterTests.cs (4)
36var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 60var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 89var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct); 117var syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedStruct);
Microsoft.Gen.Logging (1)
Parsing\Parser.cs (1)
53SyntaxTree syntaxTree = group.Key;
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (1)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree);
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
GeneratorTests.cs (1)
256public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => throw new NotSupportedException();
Microsoft.Gen.MetricsReports.Unit.Tests (1)
GeneratorTests.cs (1)
193public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => throw new NotSupportedException();
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportFixer.cs (2)
584SyntaxTree documentSyntaxTree, 641private static bool ShouldUseCollectionExpression(Document document, SyntaxTree syntaxTree)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
181SyntaxTree userSyntaxTree = methodSyntax.SyntaxTree;
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
180SyntaxTree userSyntaxTree = methodSyntax.SyntaxTree;
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
187var tree = CSharpSyntaxTree.ParseText(trainProgramCSFileContent);
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
170var tree = await document.GetSyntaxTreeAsync(cancellationToken); 181var tree = await document.GetSyntaxTreeAsync(cancellationToken);
QuarantineTools.Tests (7)
ActiveIssueTests.cs (3)
85var tree = CSharpSyntaxTree.ParseText(code); 238var tree = CSharpSyntaxTree.ParseText(code); 281var tree = CSharpSyntaxTree.ParseText(code);
QuarantineScriptTests.cs (4)
87var tree = CSharpSyntaxTree.ParseText(code); 139var tree = CSharpSyntaxTree.ParseText(code); 168var tree = CSharpSyntaxTree.ParseText(updated1); 225var tree = CSharpSyntaxTree.ParseText(code);
Roslyn.Diagnostics.Analyzers (127)
AbstractCreateTestAccessor`1.cs (1)
62var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
AbstractExposeMemberForTesting`1.cs (1)
104var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken) 118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (3)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 25/// <inheritdoc cref="VerifySource(SyntaxTree, IEnumerable{TextChangeRange}?)"/> 111public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>();
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
199foreach (var tree in compilation.SyntaxTrees)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
31public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 48public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (9)
31ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 34private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 36private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions) 67var perTreeOptionsBuilder = PooledDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance(); 68foreach (var tree in compilation.SyntaxTrees) 75static SyntaxTreeCategorizedAnalyzerConfigOptions Create(SyntaxTree tree, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider) 82public T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 100public T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality) 110private bool TryGetOptionValue<T, TArg>(string optionName, OptionKind kind, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, [MaybeNullWhen(false)] out T value)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (30)
29private static bool TryGetSyntaxTreeForOption(ISymbol symbol, [NotNullWhen(returnValue: true)] out SyntaxTree? tree) 51=> TryGetSyntaxTreeForOption(symbol, out var tree) 58SyntaxTree tree, 69=> TryGetSyntaxTreeForOption(symbol, out var tree) 76SyntaxTree tree, 87=> TryGetSyntaxTreeForOption(symbol, out var tree) 94SyntaxTree tree, 102SyntaxTree tree, 109SyntaxTree tree, 120=> TryGetSyntaxTreeForOption(symbol, out var tree) 127SyntaxTree tree, 136SyntaxTree tree, 152SyntaxTree tree, 179SyntaxTree tree, 192=> TryGetSyntaxTreeForOption(symbol, out var tree) 200SyntaxTree tree, 212SyntaxTree tree, 224SyntaxTree tree, 240SyntaxTree tree, 247SyntaxTree tree, 300=> TryGetSyntaxTreeForOption(symbol, out var tree) 309=> TryGetSyntaxTreeForOption(symbol, out var tree) 324SyntaxTree? tree, 338SyntaxTree? tree, 387SyntaxTree? tree, 426SyntaxTree tree, 434SyntaxTree tree, 441SyntaxTree tree, 448SyntaxTree tree, 456SyntaxTree? tree,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\ICategorizedAnalyzerConfigOptions.cs (2)
51T GetOptionValue<T>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T> tryParseValue, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality); 53T GetOptionValue<T, TArg>(string optionName, SyntaxTree? tree, DiagnosticDescriptor? rule, TryParseValue<T, TArg> tryParseValue, TArg arg, T defaultValue, OptionKind kind = OptionKind.DotnetCodeQuality);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
43public static bool ShouldAnalyzeSpan(this SymbolStartAnalysisContext context, TextSpan span, SyntaxTree tree) 63public static bool ShouldAnalyzeSpan(this SymbolAnalysisContext context, TextSpan span, SyntaxTree tree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
64public static ReportDiagnostic GetEffectiveSeverity(this DiagnosticDescriptor descriptor, CompilationOptions compilationOptions, SyntaxTree tree, AnalyzerOptions analyzerOptions) 148(SyntaxTreeOptionsProvider provider, SyntaxTree tree)? providerAndTree = null) 157var tree = providerAndTree.Value.tree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (2)
12public static SyntaxTree GetSourceTreeOrThrow(this Location location) 37var tree = loc.SourceTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (13)
18public static bool OverlapsHiddenPosition([NotNullWhen(returnValue: true)] this SyntaxTree? tree, TextSpan span, CancellationToken cancellationToken) 38public static bool IsScript(this SyntaxTree syntaxTree) 46this SyntaxTree syntaxTree, 56this SyntaxTree syntaxTree, 65this SyntaxTree syntaxTree, 98public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken) 123public static bool IsBeforeFirstToken(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 171this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false) 204this SyntaxTree syntaxTree, 219this SyntaxTree syntaxTree, 230public static bool IsGeneratedCode(this SyntaxTree syntaxTree, AnalyzerOptions? analyzerOptions, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 252public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
44SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 70public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) 90SyntaxTree tree, SyntaxToken token, int position, CancellationToken cancellationToken) 96SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (1)
170var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
34public readonly SyntaxTree Tree; 42SyntaxTree tree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
34SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 38SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken) 42SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (4)
164bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 192bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken); 429TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree tree, int position, CancellationToken cancellationToken); 497bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
38var syntaxTree = reader.GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
46var syntaxTree = location.SourceTree; 49failureReason = $"({nameof(AnonymousFunctionOrDelegateSymbolKey)} {nameof(SyntaxTree)} failed)";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (8)
77var syntaxTree = locations[0]!.SourceTree; 100private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 115Compilation compilation, SyntaxTree? syntaxTree, 181var firstSourceTree = locations[0]?.SourceTree; 202SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 273private static bool Contains(IEnumerable<SyntaxTree> trees, SyntaxTree tree) 275foreach (var current in trees)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
453internal SyntaxTree? GetSyntaxTree(string filePath) 455foreach (var tree in this.Compilation.SyntaxTrees) 671var syntaxTree = GetSyntaxTree(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
145public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (1)
136public bool TryResolve<TNode>(SyntaxTree syntaxTree, CancellationToken cancellationToken, [NotNullWhen(true)] out TNode? node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
241var destinationTree = destinationDeclaration.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
78var syntaxTree = destination.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (1)
50public SyntaxTree SyntaxTree { get; } = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 59if (document.TryGetSyntaxTree(out var syntaxTree)) 239var syntaxTree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
26var syntaxTree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (2)
15bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 18Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (6)
51var previousSyntaxTree = previousSemanticModel.SyntaxTree; 52var currentSyntaxTree = currentBodyNode.SyntaxTree; 178private readonly SyntaxTree _originalSyntaxTree; 179private readonly SyntaxTree _updatedSyntaxTree; 182public NonEquivalentTreeException(string message, SyntaxTree originalSyntaxTree, SyntaxTree updatedSyntaxTree)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (1)
32/// at. In other words, they must be <see cref="SyntaxTree.IsEquivalentTo"/><c>(..., topLevel: true)</c>. This
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Roslyn.Diagnostics.CSharp.Analyzers (115)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
15public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
246var syntaxTree = genericIdentifier.SyntaxTree!;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (29)
17public static ISet<SyntaxKind> GetPrecedingModifiers(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 21this SyntaxTree syntaxTree, 42this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 48this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 54this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 80this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 92public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, SyntaxToken targetToken, CancellationToken cancellationToken) 99public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 102public static bool IsRightOfDot(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken) 119public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 125public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken) 133public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 145public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 155public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 168public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 180this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 224this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 242this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 259this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 273this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 297this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 382this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 389public static bool IsEntirelyWithinStringLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 393this SyntaxTree syntaxTree, int position, out SyntaxToken stringLiteral, CancellationToken cancellationToken) 442this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 470this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 532public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 540public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
154this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
128public bool IsPreProcessorDirectiveContext(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 132public bool IsEntirelyWithinStringOrCharOrNumericLiteral([NotNullWhen(true)] SyntaxTree? syntaxTree, int position, CancellationToken cancellationToken) 1013public TextSpan GetInactiveRegionSpanAroundPosition(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1442public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (1)
278var tree = token1.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
168var tree = semanticModel.SyntaxTree; 179var newTree = tree.WithRootAndOptions(newRoot, tree.Options);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (3)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options); 203var contextTree = contextLocation != null && contextLocation.IsInSource
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
187var syntaxTree = semanticModel.SyntaxTree;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (64)
29public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 78this SyntaxTree syntaxTree, 138this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 240this SyntaxTree syntaxTree, 320this SyntaxTree syntaxTree, 336public static bool IsLocalFunctionDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 340this SyntaxTree syntaxTree, 369this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 529this SyntaxTree syntaxTree, 622this SyntaxTree syntaxTree, 676public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 693public static bool IsPartialTypeDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, [NotNullWhen(true)] out TypeDeclarationSyntax? declarationSyntax) 715public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 726this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 776public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 794public static bool IsUsingAliasTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 810public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 822this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 850this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 868public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 899public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 911public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 924this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 937this SyntaxTree syntaxTree, 962public static bool IsGenericConstraintContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 967this SyntaxTree syntaxTree, 1055this SyntaxTree syntaxTree, 1145this SyntaxTree syntaxTree, 1173this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1188this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1202public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1219public static bool IsPossibleExtensionMethodContext(this SyntaxTree syntaxTree, SyntaxToken tokenOnLeftOfPosition) 1231this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1263this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1290this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1315public static bool IsPossibleTupleContext(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1370public static bool IsAtStartOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1464public static bool IsAtEndOfPattern(this SyntaxTree syntaxTree, SyntaxToken leftToken, int position) 1607public static bool IsPossibleDeconstructionDesignation(this SyntaxTree syntaxTree, 1717this SyntaxTree syntaxTree, 1757this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1774this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1888this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1905public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1922public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 1934this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1952private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1959public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 1966public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 1984public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2007public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2038this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) 2051public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2065public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, 2145public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 2171this SyntaxTree syntaxTree, 2749public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2816this SyntaxTree syntaxTree, 2938this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2973public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 2998public static bool IsBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3011public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, SyntaxToken targetToken) 3023public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 3078public static bool IsFunctionPointerCallingConventionContext(this SyntaxTree syntaxTree, SyntaxToken targetToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
14public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition) 22public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 32this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 38this SyntaxTree syntaxTree, 47this SyntaxTree syntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (2)
28public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
196var syntaxTree = SemanticModel.SyntaxTree;
Roslyn.Diagnostics.VisualBasic.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
638Public Function ReplaceStatements(tree As SyntaxTree, 714tree As SyntaxTree,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (4)
128Public Function IsPreProcessorDirectiveContext(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsPreProcessorDirectiveContext 132Public Function IsEntirelyWithinStringOrCharOrNumericLiteral(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral 1084Public Function GetInactiveRegionSpanAroundPosition(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As TextSpan Implements ISyntaxFacts.GetInactiveRegionSpanAroundPosition 1679Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion
SuperFileCheck (1)
Program.cs (1)
265var syntaxTree = CSharpSyntaxTree.ParseText(SourceText.From(File.ReadAllText(filePath)));
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Parser.cs (2)
299SyntaxTree? canonicalTree = null; 308SyntaxTree? attributeTree = attributeData.ApplicationSyntaxReference?.SyntaxTree;
System.Text.RegularExpressions.Generator (4)
UpgradeToGeneratedRegexAnalyzer.cs (1)
182SyntaxTree? tree = syntaxNode.SyntaxTree;
UpgradeToGeneratedRegexCodeFixer.cs (3)
493var treeIndexMap = new Dictionary<SyntaxTree, int>(); 495foreach (SyntaxTree tree in compilation.SyntaxTrees) 501var semanticModelCache = new Dictionary<SyntaxTree, SemanticModel>();
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
203var semanticModelCache = new Dictionary<SyntaxTree, SemanticModel>(); 233SemanticModel GetSemanticModel(Compilation compilation, SyntaxTree syntaxTree)