157 references to PatternMatchKind
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (85)
Utilities\PatternMatcherTests.cs (85)
128[InlineData("[|Goo|]", "Goo", PatternMatchKind.Exact, CaseSensitive)] 129[InlineData("[|goo|]", "Goo", PatternMatchKind.Exact, CaseInsensitive)] 130[InlineData("[|Goo|]", "goo", PatternMatchKind.Exact, CaseInsensitive)] 132[InlineData("[|Fo|]o", "Fo", PatternMatchKind.Prefix, CaseSensitive)] 133[InlineData("[|Fog|]Bar", "Fog", PatternMatchKind.Prefix, CaseSensitive)] 135[InlineData("[|Fo|]o", "fo", PatternMatchKind.Prefix, CaseInsensitive)] 136[InlineData("[|Fog|]Bar", "fog", PatternMatchKind.Prefix, CaseInsensitive)] 137[InlineData("[|fog|]BarGoo", "Fog", PatternMatchKind.Prefix, CaseInsensitive)] 139[InlineData("[|system.ref|]lection", "system.ref", PatternMatchKind.Prefix, CaseSensitive)] 141[InlineData("Fog[|B|]ar", "b", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 143[InlineData("_[|my|]Button", "my", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 144[InlineData("my[|_b|]utton", "_b", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 145[InlineData("_[|my|]button", "my", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 146[InlineData("_my[|_b|]utton", "_b", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 147[InlineData("_[|myb|]utton", "myb", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 148[InlineData("_[|myB|]utton", "myB", PatternMatchKind.NonLowercaseSubstring, CaseSensitive)] 150[InlineData("my[|_B|]utton", "_b", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 151[InlineData("_my[|_B|]utton", "_b", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 152[InlineData("_[|myB|]utton", "myb", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 154[InlineData("[|AbCd|]xxx[|Ef|]Cd[|Gh|]", "AbCdEfGh", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseSensitive)] 156[InlineData("A[|BCD|]EFGH", "bcd", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 157[InlineData("FogBar[|ChangedEventArgs|]", "changedeventargs", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 158[InlineData("Abcdefghij[|EfgHij|]", "efghij", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 160[InlineData("[|F|]og[|B|]ar", "FB", PatternMatchKind.CamelCaseExact, CaseSensitive)] 161[InlineData("[|Fo|]g[|B|]ar", "FoB", PatternMatchKind.CamelCaseExact, CaseSensitive)] 162[InlineData("[|_f|]og[|B|]ar", "_fB", PatternMatchKind.CamelCaseExact, CaseSensitive)] 163[InlineData("[|F|]og[|_B|]ar", "F_B", PatternMatchKind.CamelCaseExact, CaseSensitive)] 164[InlineData("[|F|]og[|B|]ar", "fB", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 165[InlineData("Baz[|F|]ogBar[|F|]oo[|F|]oo", "FFF", PatternMatchKind.CamelCaseNonContiguousSubstring, CaseSensitive)] 166[InlineData("[|F|]og[|B|]arBaz", "FB", PatternMatchKind.CamelCasePrefix, CaseSensitive)] 167[InlineData("[|F|]og_[|B|]ar", "FB", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseSensitive)] 168[InlineData("[|F|]ooFlob[|B|]az", "FB", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseSensitive)] 169[InlineData("Bar[|F|]oo[|F|]oo[|F|]oo", "FFF", PatternMatchKind.CamelCaseSubstring, CaseSensitive)] 170[InlineData("BazBar[|F|]oo[|F|]oo[|F|]oo", "FFF", PatternMatchKind.CamelCaseSubstring, CaseSensitive)] 171[InlineData("[|Fo|]oBarry[|Bas|]il", "FoBas", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseSensitive)] 172[InlineData("[|F|]ogBar[|F|]oo[|F|]oo", "FFF", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseSensitive)] 174[InlineData("[|F|]og[|_B|]ar", "F_b", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 175[InlineData("[|_F|]og[|B|]ar", "_fB", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 176[InlineData("[|F|]og[|_B|]ar", "f_B", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 178[InlineData("[|Si|]mple[|UI|]Element", "SiUI", PatternMatchKind.CamelCaseExact, CaseSensitive)] 180[InlineData("_[|co|]deFix[|Pro|]vider", "copro", PatternMatchKind.CamelCaseNonContiguousSubstring, CaseInsensitive)] 181[InlineData("Code[|Fi|]xObject[|Pro|]vider", "fipro", PatternMatchKind.CamelCaseNonContiguousSubstring, CaseInsensitive)] 182[InlineData("[|Co|]de[|Fi|]x[|Pro|]vider", "cofipro", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 183[InlineData("Code[|Fi|]x[|Pro|]vider", "fipro", PatternMatchKind.CamelCaseSubstring, CaseInsensitive)] 184[InlineData("[|Co|]deFix[|Pro|]vider", "copro", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseInsensitive)] 185[InlineData("[|co|]deFix[|Pro|]vider", "copro", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseInsensitive)] 186[InlineData("[|Co|]deFix_[|Pro|]vider", "copro", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseInsensitive)] 187[InlineData("[|C|]ore[|Ofi|]lac[|Pro|]fessional", "cofipro", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 188[InlineData("[|C|]lear[|Ofi|]lac[|Pro|]fessional", "cofipro", PatternMatchKind.CamelCaseExact, CaseInsensitive)] 189[InlineData("[|CO|]DE_FIX_[|PRO|]VIDER", "copro", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseInsensitive)] 191[InlineData("my[|_b|]utton", "_B", PatternMatchKind.CamelCaseSubstring, CaseInsensitive)] 192[InlineData("[|_|]my_[|b|]utton", "_B", PatternMatchKind.CamelCaseNonContiguousPrefix, CaseInsensitive)] 193[InlineData("Com[|bin|]e", "bin", PatternMatchKind.LowercaseSubstring, CaseSensitive)] 194[InlineData("Combine[|Bin|]ary", "bin", PatternMatchKind.StartOfWordSubstring, CaseInsensitive)] 196[InlineData("_ABC_[|Abc|]_", "Abc", PatternMatchKind.StartOfWordSubstring, CaseSensitive)] 197[InlineData("[|C|]reate[|R|]ange", "CR", PatternMatchKind.CamelCaseExact, CaseSensitive)] 202string candidate, string pattern, PatternMatchKind matchKind, bool isCaseSensitive) 230private static void AssertContainsType(PatternMatchKind type, IEnumerable<PatternMatch> results) 238AssertContainsType(PatternMatchKind.Exact, match); 246AssertContainsType(PatternMatchKind.Prefix, match); 254AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 262AssertContainsType(PatternMatchKind.Prefix, match); 270AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 278AssertContainsType(PatternMatchKind.Prefix, match); 286AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 294AssertContainsType(PatternMatchKind.Prefix, match); 295AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 303AssertContainsType(PatternMatchKind.Prefix, match); 304AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 312AssertContainsType(PatternMatchKind.CamelCasePrefix, match); 320Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 328Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 336AssertContainsType(PatternMatchKind.CamelCaseExact, match); 352AssertContainsType(PatternMatchKind.Prefix, match); 353AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 361AssertContainsType(PatternMatchKind.Prefix, match); 362AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 370AssertContainsType(PatternMatchKind.Prefix, match); 371AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 387Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 398AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 413Assert.Equal(PatternMatchKind.Exact, match.Value.Kind);
Microsoft.CodeAnalysis.Features (32)
Completion\CompletionHelper.cs (8)
240if (match1.Kind != PatternMatchKind.Exact && match2.Kind != PatternMatchKind.Exact) 261if (!isItem1Expanded && match1.Kind <= PatternMatchKind.Prefix) 266if (!isItem2Expanded && match2.Kind <= PatternMatchKind.Prefix) 273Debug.Assert(isItem1Expanded && match1.Kind == PatternMatchKind.Exact && !isItem2Expanded && match2.Kind > PatternMatchKind.Prefix || 274isItem2Expanded && match2.Kind == PatternMatchKind.Exact && !isItem1Expanded && match1.Kind > PatternMatchKind.Prefix);
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (12)
26private static readonly ImmutableArray<(PatternMatchKind roslynKind, NavigateToMatchKind vsKind)> s_kindPairs = 28(PatternMatchKind.Exact, NavigateToMatchKind.Exact), 29(PatternMatchKind.Prefix, NavigateToMatchKind.Prefix), 30(PatternMatchKind.NonLowercaseSubstring, NavigateToMatchKind.Substring), 31(PatternMatchKind.StartOfWordSubstring, NavigateToMatchKind.Substring), 32(PatternMatchKind.CamelCaseExact, NavigateToMatchKind.CamelCaseExact), 33(PatternMatchKind.CamelCasePrefix, NavigateToMatchKind.CamelCasePrefix), 34(PatternMatchKind.CamelCaseNonContiguousPrefix, NavigateToMatchKind.CamelCaseNonContiguousPrefix), 35(PatternMatchKind.CamelCaseSubstring, NavigateToMatchKind.CamelCaseSubstring), 36(PatternMatchKind.CamelCaseNonContiguousSubstring, NavigateToMatchKind.CamelCaseNonContiguousSubstring), 37(PatternMatchKind.Fuzzy, NavigateToMatchKind.Fuzzy), 38(PatternMatchKind.LowercaseSubstring, NavigateToMatchKind.Fuzzy),
NavigateTo\INavigateToSearchResult.cs (12)
42private static PatternMatchKind GetPatternMatchKind(NavigateToMatchKind matchKind) 45NavigateToMatchKind.Exact => PatternMatchKind.Exact, 46NavigateToMatchKind.Prefix => PatternMatchKind.Prefix, 47NavigateToMatchKind.Substring => PatternMatchKind.NonLowercaseSubstring, 48NavigateToMatchKind.Regular => PatternMatchKind.Fuzzy, 49NavigateToMatchKind.None => PatternMatchKind.Fuzzy, 50NavigateToMatchKind.CamelCaseExact => PatternMatchKind.CamelCaseExact, 51NavigateToMatchKind.CamelCasePrefix => PatternMatchKind.CamelCasePrefix, 52NavigateToMatchKind.CamelCaseNonContiguousPrefix => PatternMatchKind.CamelCaseNonContiguousPrefix, 53NavigateToMatchKind.CamelCaseSubstring => PatternMatchKind.CamelCaseSubstring, 54NavigateToMatchKind.CamelCaseNonContiguousSubstring => PatternMatchKind.CamelCaseNonContiguousSubstring, 55NavigateToMatchKind.Fuzzy => PatternMatchKind.Fuzzy,
Microsoft.CodeAnalysis.Workspaces (28)
PatternMatching\AllLowerCamelCaseMatcher.cs (3)
38public PatternMatchKind? TryMatch( 66private static PatternMatchKind GetKind(CamelCaseResult result, in TemporaryArray<TextSpan> candidateHumps) 238return GetKind(result, candidateHumps) == PatternMatchKind.CamelCaseExact;
PatternMatching\CamelCaseResult.cs (6)
47private static PatternMatchKind GetCamelCaseKind(CamelCaseResult result, in TemporaryArray<TextSpan> candidateHumps) 58? PatternMatchKind.CamelCaseExact 59: PatternMatchKind.CamelCasePrefix; 63return PatternMatchKind.CamelCaseNonContiguousPrefix; 71? PatternMatchKind.CamelCaseSubstring 72: PatternMatchKind.CamelCaseNonContiguousSubstring;
PatternMatching\PatternMatch.cs (3)
19public PatternMatchKind Kind { get; } 38PatternMatchKind resultType, 48PatternMatchKind kind,
PatternMatching\PatternMatcher.cs (11)
156PatternMatchKind.Fuzzy, punctuationStripped, isCaseSensitive: false, matchedSpan: null); 181PatternMatchKind.Exact, punctuationStripped, isCaseSensitive: candidate == patternChunk.Text, 207PatternMatchKind.Prefix, punctuationStripped, isCaseSensitive, matchedSpan: GetMatchedSpan(0, patternChunk.Text.Length)); 227var resultType = char.IsUpper(candidate[caseSensitiveIndex]) ? PatternMatchKind.StartOfWordSubstring : PatternMatchKind.NonLowercaseSubstring; 245return new PatternMatch(PatternMatchKind.StartOfWordSubstring, punctuationStripped, 260return new PatternMatch(PatternMatchKind.StartOfWordSubstring, punctuationStripped, 293PatternMatchKind.LowercaseSubstring, punctuationStripped, isCaseSensitive: true, 503private PatternMatchKind? TryAllLowerCamelCaseMatch( 513private PatternMatchKind? TryUpperCaseCamelCaseMatch(
PatternMatching\PatternMatchKind.cs (5)
111public static bool IsCamelCaseKind(this PatternMatchKind kind) 112=> kind is PatternMatchKind.CamelCaseExact or PatternMatchKind.CamelCasePrefix or PatternMatchKind.CamelCaseNonContiguousPrefix or PatternMatchKind.CamelCaseSubstring;
Microsoft.VisualStudio.LanguageServices (12)
NavigateTo\RoslynNavigateToSearchCallback.cs (12)
89private static PatternMatchKind ConvertKind(PatternMatching.PatternMatchKind kind) 92PatternMatching.PatternMatchKind.Exact => PatternMatchKind.Exact, 93PatternMatching.PatternMatchKind.Prefix => PatternMatchKind.Prefix, 94PatternMatching.PatternMatchKind.NonLowercaseSubstring => PatternMatchKind.Substring, 95PatternMatching.PatternMatchKind.StartOfWordSubstring => PatternMatchKind.Substring, 96PatternMatching.PatternMatchKind.CamelCaseExact => PatternMatchKind.CamelCaseExact, 97PatternMatching.PatternMatchKind.CamelCasePrefix => PatternMatchKind.CamelCasePrefix, 98PatternMatching.PatternMatchKind.CamelCaseNonContiguousPrefix => PatternMatchKind.CamelCaseNonContiguousPrefix, 99PatternMatching.PatternMatchKind.CamelCaseSubstring => PatternMatchKind.CamelCaseSubstring, 100PatternMatching.PatternMatchKind.CamelCaseNonContiguousSubstring => PatternMatchKind.CamelCaseNonContiguousSubstring, 101PatternMatching.PatternMatchKind.Fuzzy => PatternMatchKind.Fuzzy, 103PatternMatching.PatternMatchKind.LowercaseSubstring => PatternMatchKind.Fuzzy,