private AnalyzerConfigSet(ImmutableArray <AnalyzerConfig> analyzerConfigs) { _analyzerConfigs = analyzerConfigs; var allMatchers = ArrayBuilder <ImmutableArray <SectionNameMatcher?> > .GetInstance(_analyzerConfigs.Length); foreach (var config in _analyzerConfigs) { // Create an array of regexes with each entry corresponding to the same index // in <see cref="EditorConfig.NamedSections"/>. var builder = ArrayBuilder <SectionNameMatcher?> .GetInstance(config.NamedSections.Length); foreach (var section in config.NamedSections) { SectionNameMatcher?matcher = AnalyzerConfig.TryCreateSectionNameMatcher(section.Name); builder.Add(matcher); } Debug.Assert(builder.Count == config.NamedSections.Length); allMatchers.Add(builder.ToImmutableAndFree()); } Debug.Assert(allMatchers.Count == _analyzerConfigs.Length); _analyzerMatchers = allMatchers.ToImmutableAndFree(); }
public void UnmatchedBraces() { SectionNameMatcher?matcher = TryCreateSectionNameMatcher("{{{{}}"); Assert.Null(matcher); }
public void CommaOutsideBraces() { SectionNameMatcher?matcher = TryCreateSectionNameMatcher("abc,def"); Assert.Null(matcher); }
public void EndBackslashMatch() { SectionNameMatcher?matcher = TryCreateSectionNameMatcher("abc\\"); Assert.Null(matcher); }