4 instantiations of Section
Microsoft.CodeAnalysis (4)
CommandLine\AnalyzerConfig.cs (1)
244var previousSection = new Section(activeSectionName, activeSectionProperties.ToImmutable());
CommandLine\AnalyzerConfigSet.cs (3)
508var unescapedSection = new Section(UnescapeSectionName(section.Name), section.Properties); 527return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty); 569return new Section(sectionName, result);
54 references to Section
Microsoft.CodeAnalysis (50)
CommandLine\AnalyzerConfig.cs (10)
52= ImmutableHashSet.CreateRange(Section.PropertiesKeyComparer, new[] { 70internal Section GlobalSection { get; } 89internal ImmutableArray<Section> NamedSections { get; } 140Section globalSection, 141ImmutableArray<Section> namedSections, 174Section? globalSection = null; 175var namedSectionBuilder = ImmutableArray.CreateBuilder<Section>(); 184Section.PropertiesKeyComparer); 211Section.PropertiesKeyComparer); 244var 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)
50private readonly ConcurrentCache<List<Section>, AnalyzerConfigOptionsResult> _optionsCache = 51new ConcurrentCache<List<Section>, AnalyzerConfigOptionsResult>(50, SequenceEqualComparer.Instance); // arbitrary size 54new ObjectPool<TreeOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, ReportDiagnostic>(Section.PropertiesKeyComparer)); 57new ObjectPool<AnalyzerOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, string>(Section.PropertiesKeyComparer)); 59private readonly ObjectPool<List<Section>> _sectionKeyPool = new ObjectPool<List<Section>>(() => new List<Section>()); 63private sealed class SequenceEqualComparer : IEqualityComparer<List<Section>> 67public bool Equals(List<Section>? x, List<Section>? y) 90public int GetHashCode(List<Section> obj) => Hash.CombineValues(obj); 147foreach (var section in config.NamedSections) 203foreach (var section in _globalConfig.NamedSections) 205if (normalizedPath.Equals(section.Name, Section.NameComparer)) 243var section = config.NamedSections[sectionIndex]; 261foreach (var configSection in _globalConfig.NamedSections) 335static void freeKey(List<Section> sectionKey, ObjectPool<List<Section>> pool) 406private 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); 503foreach (var section in config.NamedSections) 508var unescapedSection = new Section(UnescapeSectionName(section.Name), section.Properties); 527return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty); 548Section globalSection = GetSection(string.Empty); 551ArrayBuilder<Section> namedSectionBuilder = new ArrayBuilder<Section>(_values.Count); 563private Section GetSection(string sectionName) 568var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value, Section.PropertiesKeyComparer); 572private void MergeSection(string configPath, Section section, int globalLevel, bool isGlobalSection) 579sectionDict = ImmutableDictionary.CreateBuilder<string, (string, string, int)>(Section.PropertiesKeyComparer); 586if (isGlobalSection && (Section.PropertiesKeyComparer.Equals(key, GlobalKey) || Section.PropertiesKeyComparer.Equals(key, GlobalLevelKey))) 619duplicateDict = ImmutableDictionary.CreateBuilder<string, (int, ArrayBuilder<string>)>(Section.PropertiesKeyComparer); 655internal AnalyzerConfig.Section GlobalSection { get; } 657internal ImmutableArray<AnalyzerConfig.Section> NamedSections { get; } 659public GlobalAnalyzerConfig(AnalyzerConfig.Section globalSection, ImmutableArray<AnalyzerConfig.Section> namedSections)
DiagnosticAnalyzer\AnalyzerConfigOptions.cs (1)
17public 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)
1640var file1Section = globalConfig.NamedSections[0]; 1641var file2Section = globalConfig.NamedSections[1]; 1642var file3Section = globalConfig.NamedSections[2];