4 instantiations of Section
Microsoft.CodeAnalysis (4)
CommandLine\AnalyzerConfig.cs (1)
269var previousSection = new Section(sectionName, activeSectionProperties.ToImmutable());
CommandLine\AnalyzerConfigSet.cs (3)
497var unescapedSection = new Section(UnescapeSectionName(section.Name), section.Properties); 516return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty); 558return new Section(sectionName, result);
50 references to Section
Microsoft.CodeAnalysis (50)
CommandLine\AnalyzerConfig.cs (10)
72= ImmutableHashSet.CreateRange(Section.PropertiesKeyComparer, new[] { 90internal Section GlobalSection { get; } 109internal ImmutableArray<Section> NamedSections { get; } 160Section globalSection, 161ImmutableArray<Section> namedSections, 194Section? globalSection = null; 195var namedSectionBuilder = ImmutableArray.CreateBuilder<Section>(); 204Section.PropertiesKeyComparer); 231Section.PropertiesKeyComparer); 269var previousSection = new Section(sectionName, activeSectionProperties.ToImmutable());
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
66/// Takes a <see cref="Section.Name"/> and creates a matcher that
CommandLine\AnalyzerConfigSet.cs (38)
51private readonly ConcurrentCache<List<Section>, AnalyzerConfigOptionsResult> _optionsCache = 52new ConcurrentCache<List<Section>, AnalyzerConfigOptionsResult>(50, SequenceEqualComparer.Instance); // arbitrary size 55new ObjectPool<TreeOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, ReportDiagnostic>(Section.PropertiesKeyComparer)); 58new ObjectPool<AnalyzerOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, string>(Section.PropertiesKeyComparer)); 60private readonly ObjectPool<List<Section>> _sectionKeyPool = new ObjectPool<List<Section>>(() => new List<Section>()); 64private sealed class SequenceEqualComparer : IEqualityComparer<List<Section>> 68public bool Equals(List<Section>? x, List<Section>? y) 91public int GetHashCode(List<Section> obj) => Hash.CombineValues(obj); 148foreach (var section in config.NamedSections) 192foreach (var section in _globalConfig.NamedSections) 194if (normalizedPath.Equals(section.Name, Section.NameComparer)) 232var section = config.NamedSections[sectionIndex]; 250foreach (var configSection in _globalConfig.NamedSections) 324static void freeKey(List<Section> sectionKey, ObjectPool<List<Section>> pool) 395private static void ParseSectionOptions(Section section, TreeOptions.Builder treeBuilder, AnalyzerOptions.Builder analyzerBuilder, ArrayBuilder<Diagnostic> diagnosticBuilder, string analyzerConfigPath, ConcurrentDictionary<ReadOnlyMemory<char>, string> diagIdCache) 487_values = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (string, string, int)>.Builder>(Section.NameEqualityComparer); 488_duplicates = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (int, ArrayBuilder<string>)>.Builder>(Section.NameEqualityComparer); 492foreach (var section in config.NamedSections) 497var unescapedSection = new Section(UnescapeSectionName(section.Name), section.Properties); 516return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty); 537Section globalSection = GetSection(string.Empty); 540ArrayBuilder<Section> namedSectionBuilder = new ArrayBuilder<Section>(_values.Count); 552private Section GetSection(string sectionName) 557var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value, Section.PropertiesKeyComparer); 561private void MergeSection(string configPath, Section section, int globalLevel, bool isGlobalSection) 568sectionDict = ImmutableDictionary.CreateBuilder<string, (string, string, int)>(Section.PropertiesKeyComparer); 575if (isGlobalSection && (Section.PropertiesKeyComparer.Equals(key, GlobalKey) || Section.PropertiesKeyComparer.Equals(key, GlobalLevelKey))) 608duplicateDict = ImmutableDictionary.CreateBuilder<string, (int, ArrayBuilder<string>)>(Section.PropertiesKeyComparer); 644internal AnalyzerConfig.Section GlobalSection { get; } 646internal ImmutableArray<AnalyzerConfig.Section> NamedSections { get; } 648public GlobalAnalyzerConfig(AnalyzerConfig.Section globalSection, ImmutableArray<AnalyzerConfig.Section> namedSections)
DiagnosticAnalyzer\AnalyzerConfigOptions.cs (1)
17public static StringComparer KeyComparer { get; } = AnalyzerConfig.Section.PropertiesKeyComparer;