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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
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)
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)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
46var tree = context.Tree;
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\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)
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)
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
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
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\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)
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\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);
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\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\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\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\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\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\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\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\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\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\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\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)