73 references to SectionMatch
Microsoft.CodeAnalysis.Workspaces (45)
EditorConfigFile.cs (4)
33
=> TryGetSectionForLanguage(language,
SectionMatch
.ExactLanguageMatch, out sectionResult);
40
SectionMatch
matchKind,
65
return TryGetSectionForFilePath(filePath,
SectionMatch
.ExactLanguageMatch, out sectionResult);
73
SectionMatch
matchKind,
Section.cs (16)
72
/// <param name="matchKind">The criteria for which we consider a language a mache the default is <see cref="
SectionMatch
.ExactLanguageMatch"/>.</param>
74
public bool SupportsLanguage(Language language,
SectionMatch
matchKind = default)
81
/// <param name="matchKind">The criteria for which we consider a language a mache the default is <see cref="
SectionMatch
.ExactLanguageMatch"/>.</param>
87
public bool SupportsFilePath(string codeFilePath,
SectionMatch
matchKind = default)
90
public
SectionMatch
GetMatchKind(Language language)
94
return
SectionMatch
.GlobalSectionMatch;
99
return
SectionMatch
.SplatMatch;
105
return
SectionMatch
.NoMatch;
111
public
SectionMatch
GetMatchKind(string codeFilePath)
115
return
SectionMatch
.GlobalSectionMatch;
120
return
SectionMatch
.SplatMatch;
126
return
SectionMatch
.NoMatch;
132
return
SectionMatch
.NoMatch;
135
var
languageMatchKind = matcher.GetLanguageMatchKind(language);
138
if (languageMatchKind.IsWorseMatchThan(
SectionMatch
.AnyLanguageMatch))
152
return
SectionMatch
.SupersetFilePatternMatch;
SectionMatcher.cs (17)
33
public bool IsLanguageMatch(Language language,
SectionMatch
matchKind = default)
36
public bool IsPathMatch(string relativePath,
SectionMatch
matchKind = default)
42
public
SectionMatch
GetLanguageMatchKind(Language language)
46
return
SectionMatch
.ExactLanguageMatch;
51
return
SectionMatch
.ExactLanguageMatchWithOthers;
56
return
SectionMatch
.AnyLanguageMatch;
63
return
SectionMatch
.SupersetFilePatternMatch;
66
return
SectionMatch
.FilePatternMatch;
69
return
SectionMatch
.NoMatch;
72
public
SectionMatch
GetPathMatchKind(string relativePath)
76
return
SectionMatch
.NoMatch;
81
return
SectionMatch
.ExactLanguageMatch;
86
return
SectionMatch
.ExactLanguageMatchWithOthers;
91
return
SectionMatch
.AnyLanguageMatch;
98
return
SectionMatch
.SupersetFilePatternMatch;
101
return
SectionMatch
.FilePatternMatch;
104
return
SectionMatch
.NoMatch;
SectionMatchExtensions.cs (8)
9
public static bool IsWorseMatchThan(this
SectionMatch
actualMatchKind,
SectionMatch
expectedMatchKind)
16
public static bool IsWorseOrEqualMatchThan(this
SectionMatch
actualMatchKind,
SectionMatch
expectedMatchKind)
23
public static bool IsBetterMatchThan(this
SectionMatch
actualMatchKind,
SectionMatch
expectedMatchKind)
30
public static bool IsBetterOrEqualMatchThan(this
SectionMatch
actualMatchKind,
SectionMatch
expectedMatchKind)
Microsoft.CodeAnalysis.Workspaces.UnitTests (28)
EditorConfigParsing\EditorConfigFileParserTests.cs (14)
79
Assert.True(parseResults.TryGetSectionForLanguage(Language.CSharp,
SectionMatch
.ExactLanguageMatchWithOthers, out var section));
95
Assert.True(parseResults.TryGetSectionForLanguage(Language.CSharp,
SectionMatch
.Any, out var section));
99
Assert.True(parseResults.TryGetSectionForLanguage(Language.VisualBasic,
SectionMatch
.Any, out section));
103
Assert.True(parseResults.TryGetSectionForLanguage((Language.CSharp | Language.VisualBasic),
SectionMatch
.Any, out section));
160
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\CSharp\Program.cs",
SectionMatch
.Any, out var section));
164
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\VisualBasic\Program.vb",
SectionMatch
.Any, out section));
179
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\CSharp\Program.cs",
SectionMatch
.Any, out var section));
183
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\VisualBasic\Program.vb",
SectionMatch
.Any, out section));
205
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\CSharp\Program.cs",
SectionMatch
.Any, out var section));
209
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\VisualBasic\Program.vb",
SectionMatch
.Any, out section));
222
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\CSharp\Program.cs",
SectionMatch
.Any, out var section));
226
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\VisualBasic\Program.vb",
SectionMatch
.Any, out section));
238
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\CSharp\Program.cs",
SectionMatch
.Any, out var section));
242
Assert.True(parseResults.TryGetSectionForFilePath(@"C:\dev\sources\VisualBasic\Program.vb",
SectionMatch
.Any, out section));
EditorConfigParsing\SectionParserTests.cs (14)
31
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.ExactLanguageMatchWithOthers));
40
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.AnyLanguageMatch));
50
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.SupersetFilePatternMatch));
60
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.SplatMatch));
70
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.GlobalSectionMatch));
104
Assert.False(section.SupportsLanguage(language, matchKind:
SectionMatch
.ExactLanguageMatchWithOthers));
113
Assert.False(section.SupportsLanguage(language, matchKind:
SectionMatch
.AnyLanguageMatch));
122
Assert.False(section.SupportsLanguage(language, matchKind:
SectionMatch
.SupersetFilePatternMatch));
136
Assert.True(section.SupportsLanguage(language, matchKind:
SectionMatch
.FilePatternMatch));
153
Assert.False(section.SupportsLanguage(language, matchKind:
SectionMatch
.FilePatternMatch));
188
Assert.True(section.SupportsFilePath(codefilePath, matchKind:
SectionMatch
.FilePatternMatch));
211
Assert.False(section.SupportsFilePath(codefilePath, matchKind:
SectionMatch
.FilePatternMatch));
220
Assert.True(section.SupportsFilePath(codefilePath, matchKind:
SectionMatch
.FilePatternMatch));
231
Assert.True(section.SupportsFilePath(codefilePath, matchKind:
SectionMatch
.SplatMatch));