4 instantiations of Section
Microsoft.CodeAnalysis (4)
CommandLine\AnalyzerConfig.cs (1)
244
var previousSection = new
Section
(activeSectionName, activeSectionProperties.ToImmutable());
CommandLine\AnalyzerConfigSet.cs (3)
508
var unescapedSection = new
Section
(UnescapeSectionName(section.Name), section.Properties);
527
return new GlobalAnalyzerConfig(new
Section
(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty);
569
return new
Section
(sectionName, result);
54 references to Section
Microsoft.CodeAnalysis (50)
CommandLine\AnalyzerConfig.cs (10)
52
= ImmutableHashSet.CreateRange(
Section
.PropertiesKeyComparer, new[] {
70
internal
Section
GlobalSection { get; }
89
internal ImmutableArray<
Section
> NamedSections { get; }
140
Section
globalSection,
141
ImmutableArray<
Section
> namedSections,
174
Section
? globalSection = null;
175
var namedSectionBuilder = ImmutableArray.CreateBuilder<
Section
>();
184
Section
.PropertiesKeyComparer);
211
Section
.PropertiesKeyComparer);
244
var
previousSection = new Section(activeSectionName, activeSectionProperties.ToImmutable());
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
62
/// Takes a <see cref="
Section
.Name"/> and creates a matcher that
CommandLine\AnalyzerConfigSet.cs (38)
50
private readonly ConcurrentCache<List<
Section
>, AnalyzerConfigOptionsResult> _optionsCache =
51
new ConcurrentCache<List<
Section
>, AnalyzerConfigOptionsResult>(50, SequenceEqualComparer.Instance); // arbitrary size
54
new ObjectPool<TreeOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, ReportDiagnostic>(
Section
.PropertiesKeyComparer));
57
new ObjectPool<AnalyzerOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, string>(
Section
.PropertiesKeyComparer));
59
private readonly ObjectPool<List<
Section
>> _sectionKeyPool = new ObjectPool<List<
Section
>>(() => new List<
Section
>());
63
private sealed class SequenceEqualComparer : IEqualityComparer<List<
Section
>>
67
public bool Equals(List<
Section
>? x, List<
Section
>? y)
90
public int GetHashCode(List<
Section
> obj) => Hash.CombineValues(obj);
147
foreach (
var
section in config.NamedSections)
203
foreach (
var
section in _globalConfig.NamedSections)
205
if (normalizedPath.Equals(section.Name,
Section
.NameComparer))
243
var
section = config.NamedSections[sectionIndex];
261
foreach (
var
configSection in _globalConfig.NamedSections)
335
static void freeKey(List<
Section
> sectionKey, ObjectPool<List<
Section
>> pool)
406
private static void ParseSectionOptions(
Section
section, TreeOptions.Builder treeBuilder, AnalyzerOptions.Builder analyzerBuilder, ArrayBuilder<Diagnostic> diagnosticBuilder, string analyzerConfigPath, ConcurrentDictionary<ReadOnlyMemory<char>, string> diagIdCache)
498
_values = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (string, string, int)>.Builder>(
Section
.NameEqualityComparer);
499
_duplicates = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (int, ArrayBuilder<string>)>.Builder>(
Section
.NameEqualityComparer);
503
foreach (
var
section in config.NamedSections)
508
var
unescapedSection = new Section(UnescapeSectionName(section.Name), section.Properties);
527
return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<
Section
>.Empty);
548
Section
globalSection = GetSection(string.Empty);
551
ArrayBuilder<
Section
> namedSectionBuilder = new ArrayBuilder<
Section
>(_values.Count);
563
private
Section
GetSection(string sectionName)
568
var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value,
Section
.PropertiesKeyComparer);
572
private void MergeSection(string configPath,
Section
section, int globalLevel, bool isGlobalSection)
579
sectionDict = ImmutableDictionary.CreateBuilder<string, (string, string, int)>(
Section
.PropertiesKeyComparer);
586
if (isGlobalSection && (
Section
.PropertiesKeyComparer.Equals(key, GlobalKey) ||
Section
.PropertiesKeyComparer.Equals(key, GlobalLevelKey)))
619
duplicateDict = ImmutableDictionary.CreateBuilder<string, (int, ArrayBuilder<string>)>(
Section
.PropertiesKeyComparer);
655
internal AnalyzerConfig.
Section
GlobalSection { get; }
657
internal ImmutableArray<AnalyzerConfig.
Section
> NamedSections { get; }
659
public GlobalAnalyzerConfig(AnalyzerConfig.
Section
globalSection, ImmutableArray<AnalyzerConfig.
Section
> namedSections)
DiagnosticAnalyzer\AnalyzerConfigOptions.cs (1)
17
public static StringComparer KeyComparer { get; } = AnalyzerConfig.
Section
.PropertiesKeyComparer;
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\TestSyntaxTreeOptionsProvider.cs (1)
32
_globalOptions = new Dictionary<string, ReportDiagnostic>(
Section
.PropertiesKeyComparer) { { globalOption.key, globalOption.diagnostic } };
Microsoft.CodeAnalysis.UnitTests (3)
Analyzers\AnalyzerConfigTests.cs (3)
1640
var
file1Section = globalConfig.NamedSections[0];
1641
var
file2Section = globalConfig.NamedSections[1];
1642
var
file3Section = globalConfig.NamedSections[2];