1 instantiation of AnalyzerConfig
Microsoft.CodeAnalysis (1)
CommandLine\AnalyzerConfig.cs (1)
262
return new
AnalyzerConfig
(globalSection!, namedSectionBuilder.ToImmutable(), pathToFile);
40 references to AnalyzerConfig
Microsoft.CodeAnalysis (34)
CommandLine\AnalyzerConfig.cs (5)
104
/// Comparer for sorting <see cref="
AnalyzerConfig
"/> files by <see cref="NormalizedDirectory"/> path length.
106
internal static Comparer<
AnalyzerConfig
> DirectoryLengthComparer { get; } = Comparer<
AnalyzerConfig
>.Create(
178
public static
AnalyzerConfig
Parse(string text, string? pathToFile)
187
public static
AnalyzerConfig
Parse(SourceText text, string? pathToFile)
CommandLine\AnalyzerConfigSet.cs (25)
18
using static Microsoft.CodeAnalysis.
AnalyzerConfig
;
25
/// Represents a set of <see cref="
AnalyzerConfig
"/>, and can compute the effective analyzer options for a given source file. This is used to
26
/// collect all the <see cref="
AnalyzerConfig
"/> files for that would apply to a compilation.
31
/// The list of <see cref="
AnalyzerConfig
" />s in this set. This list has been sorted per <see cref="
AnalyzerConfig
.DirectoryLengthComparer"/>.
34
private readonly ImmutableArray<
AnalyzerConfig
> _analyzerConfigs;
40
/// corresponds to each <see cref="
AnalyzerConfig
.NamedSections"/>.
121
public static AnalyzerConfigSet Create<TList>(TList analyzerConfigs) where TList : IReadOnlyCollection<
AnalyzerConfig
>
126
public static AnalyzerConfigSet Create<TList>(TList analyzerConfigs, out ImmutableArray<Diagnostic> diagnostics) where TList : IReadOnlyCollection<
AnalyzerConfig
>
128
var sortedAnalyzerConfigs = ArrayBuilder<
AnalyzerConfig
>.GetInstance(analyzerConfigs.Count);
130
sortedAnalyzerConfigs.Sort(
AnalyzerConfig
.DirectoryLengthComparer);
136
private AnalyzerConfigSet(ImmutableArray<
AnalyzerConfig
> analyzerConfigs, GlobalAnalyzerConfig globalConfig)
143
foreach (
var
config in _analyzerConfigs)
150
SectionNameMatcher? matcher =
AnalyzerConfig
.TryCreateSectionNameMatcher(section.Name);
172
/// Returns a <see cref="AnalyzerConfigOptionsResult"/> for a source file. This computes which <see cref="
AnalyzerConfig
"/> rules applies to this file, and correctly applies
206
var
config = _analyzerConfigs[analyzerConfigIndex];
273
AnalyzerConfig
config = _analyzerConfigs[analyzerConfigIndex];
450
/// <param name="analyzerConfigs">An <see cref="ArrayBuilder{T}"/> of <see cref="
AnalyzerConfig
"/> containing a mix of regular and unmerged partial global configs</param>
453
internal static GlobalAnalyzerConfig MergeGlobalConfigs(ArrayBuilder<
AnalyzerConfig
> analyzerConfigs, out ImmutableArray<Diagnostic> diagnostics)
483
internal void MergeIntoGlobalConfig(
AnalyzerConfig
config, DiagnosticBag diagnostics)
636
/// We parse all <see cref="
AnalyzerConfig
"/>s as individual files, according to the editorconfig spec.
644
internal
AnalyzerConfig
.Section GlobalSection { get; }
646
internal ImmutableArray<
AnalyzerConfig
.Section> NamedSections { get; }
648
public GlobalAnalyzerConfig(
AnalyzerConfig
.Section globalSection, ImmutableArray<
AnalyzerConfig
.Section> namedSections)
CommandLine\CommonCompiler.cs (3)
289
var configs = ArrayBuilder<
AnalyzerConfig
>.GetInstance(analyzerConfigPaths.Length);
307
var
editorConfig =
AnalyzerConfig
.Parse(fileContent, normalizedPath);
DiagnosticAnalyzer\AnalyzerConfigOptions.cs (1)
17
public static StringComparer KeyComparer { get; } =
AnalyzerConfig
.Section.PropertiesKeyComparer;
Microsoft.CodeAnalysis.Workspaces (6)
Workspace\Solution\AnalyzerConfigDocumentState.cs (6)
15
private readonly AsyncLazy<
AnalyzerConfig
> _lazyAnalyzerConfig;
23
AsyncLazy<
AnalyzerConfig
>? lazyAnalyzerConfig = null)
27
asynchronousComputeFunction: static async (self, cancellationToken) =>
AnalyzerConfig
.Parse(await self.GetTextAsync(cancellationToken).ConfigureAwait(false), self.FilePath),
28
synchronousComputeFunction: static (self, cancellationToken) =>
AnalyzerConfig
.Parse(self.GetTextSynchronously(cancellationToken), self.FilePath),
79
public
AnalyzerConfig
GetAnalyzerConfig(CancellationToken cancellationToken)
82
public Task<
AnalyzerConfig
> GetAnalyzerConfigAsync(CancellationToken cancellationToken)