149 references to PatternMatchKind
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (83)
Utilities\PatternMatcherTests.cs (83)
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)] 197string candidate, string pattern, PatternMatchKind matchKind, bool isCaseSensitive) 225private static void AssertContainsType(PatternMatchKind type, IEnumerable<PatternMatch> results) 233AssertContainsType(PatternMatchKind.Exact, match); 241AssertContainsType(PatternMatchKind.Prefix, match); 249AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 257AssertContainsType(PatternMatchKind.Prefix, match); 265AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 273AssertContainsType(PatternMatchKind.Prefix, match); 281AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 289AssertContainsType(PatternMatchKind.Prefix, match); 290AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 298AssertContainsType(PatternMatchKind.Prefix, match); 299AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 307AssertContainsType(PatternMatchKind.CamelCasePrefix, match); 315Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 323Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 331AssertContainsType(PatternMatchKind.CamelCaseExact, match); 347AssertContainsType(PatternMatchKind.Prefix, match); 348AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 356AssertContainsType(PatternMatchKind.Prefix, match); 357AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 365AssertContainsType(PatternMatchKind.Prefix, match); 366AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 382Assert.True(match.Select(m => m.Kind).SequenceEqual(new[] { PatternMatchKind.StartOfWordSubstring, PatternMatchKind.StartOfWordSubstring })); 393AssertContainsType(PatternMatchKind.StartOfWordSubstring, match); 408Assert.Equal(PatternMatchKind.Exact, match.Value.Kind);
Microsoft.CodeAnalysis.Features (32)
Completion\CompletionHelper.cs (8)
242if (match1.Kind != PatternMatchKind.Exact && match2.Kind != PatternMatchKind.Exact) 263if (!isItem1Expanded && match1.Kind <= PatternMatchKind.Prefix) 268if (!isItem2Expanded && match2.Kind <= PatternMatchKind.Prefix) 275Debug.Assert(isItem1Expanded && match1.Kind == PatternMatchKind.Exact && !isItem2Expanded && match2.Kind > PatternMatchKind.Prefix || 276isItem2Expanded && match2.Kind == PatternMatchKind.Exact && !isItem1Expanded && match1.Kind > PatternMatchKind.Prefix);
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (12)
24private static readonly ImmutableArray<(PatternMatchKind roslynKind, NavigateToMatchKind vsKind)> s_kindPairs = 26(PatternMatchKind.Exact, NavigateToMatchKind.Exact), 27(PatternMatchKind.Prefix, NavigateToMatchKind.Prefix), 28(PatternMatchKind.NonLowercaseSubstring, NavigateToMatchKind.Substring), 29(PatternMatchKind.StartOfWordSubstring, NavigateToMatchKind.Substring), 30(PatternMatchKind.CamelCaseExact, NavigateToMatchKind.CamelCaseExact), 31(PatternMatchKind.CamelCasePrefix, NavigateToMatchKind.CamelCasePrefix), 32(PatternMatchKind.CamelCaseNonContiguousPrefix, NavigateToMatchKind.CamelCaseNonContiguousPrefix), 33(PatternMatchKind.CamelCaseSubstring, NavigateToMatchKind.CamelCaseSubstring), 34(PatternMatchKind.CamelCaseNonContiguousSubstring, NavigateToMatchKind.CamelCaseNonContiguousSubstring), 35(PatternMatchKind.Fuzzy, NavigateToMatchKind.Fuzzy), 37(PatternMatchKind.LowercaseSubstring, NavigateToMatchKind.Fuzzy));
NavigateTo\INavigateToSearchResult.cs (12)
45private static PatternMatchKind GetPatternMatchKind(NavigateToMatchKind matchKind) 48NavigateToMatchKind.Exact => PatternMatchKind.Exact, 49NavigateToMatchKind.Prefix => PatternMatchKind.Prefix, 50NavigateToMatchKind.Substring => PatternMatchKind.NonLowercaseSubstring, 51NavigateToMatchKind.Regular => PatternMatchKind.Fuzzy, 52NavigateToMatchKind.None => PatternMatchKind.Fuzzy, 53NavigateToMatchKind.CamelCaseExact => PatternMatchKind.CamelCaseExact, 54NavigateToMatchKind.CamelCasePrefix => PatternMatchKind.CamelCasePrefix, 55NavigateToMatchKind.CamelCaseNonContiguousPrefix => PatternMatchKind.CamelCaseNonContiguousPrefix, 56NavigateToMatchKind.CamelCaseSubstring => PatternMatchKind.CamelCaseSubstring, 57NavigateToMatchKind.CamelCaseNonContiguousSubstring => PatternMatchKind.CamelCaseNonContiguousSubstring, 58NavigateToMatchKind.Fuzzy => PatternMatchKind.Fuzzy,
Microsoft.CodeAnalysis.Workspaces (22)
PatternMatching\AllLowerCamelCaseMatcher.cs (3)
48public PatternMatchKind? TryMatch( 76private static PatternMatchKind GetKind(CamelCaseResult result, in TemporaryArray<TextSpan> candidateHumps) 248return GetKind(result, candidateHumps) == PatternMatchKind.CamelCaseExact;
PatternMatching\CamelCaseResult.cs (6)
46private static PatternMatchKind GetCamelCaseKind(CamelCaseResult result, in TemporaryArray<TextSpan> candidateHumps) 57? PatternMatchKind.CamelCaseExact 58: PatternMatchKind.CamelCasePrefix; 62return PatternMatchKind.CamelCaseNonContiguousPrefix; 70? PatternMatchKind.CamelCaseSubstring 71: PatternMatchKind.CamelCaseNonContiguousSubstring;
PatternMatching\PatternMatch.cs (3)
20public PatternMatchKind Kind { get; } 39PatternMatchKind resultType, 49PatternMatchKind kind,
PatternMatching\PatternMatcher.cs (10)
141PatternMatchKind.Fuzzy, punctuationStripped, isCaseSensitive: false, matchedSpan: null); 164PatternMatchKind.Exact, punctuationStripped, isCaseSensitive: candidate == patternChunk.Text, 171PatternMatchKind.Prefix, punctuationStripped, isCaseSensitive: _compareInfo.IsPrefix(candidate, patternChunk.Text), 197PatternMatchKind.StartOfWordSubstring, punctuationStripped, isCaseSensitive: true, 203PatternMatchKind.NonLowercaseSubstring, punctuationStripped, isCaseSensitive: true, 218return new PatternMatch(PatternMatchKind.StartOfWordSubstring, punctuationStripped, 232return new PatternMatch(PatternMatchKind.StartOfWordSubstring, punctuationStripped, 264PatternMatchKind.LowercaseSubstring, punctuationStripped, isCaseSensitive: true, 465private PatternMatchKind? TryAllLowerCamelCaseMatch( 475private PatternMatchKind? TryUpperCaseCamelCaseMatch(
Microsoft.VisualStudio.LanguageServices (12)
NavigateTo\RoslynNavigateToSearchCallback.cs (12)
82private static PatternMatchKind ConvertKind(PatternMatching.PatternMatchKind kind) 85PatternMatching.PatternMatchKind.Exact => PatternMatchKind.Exact, 86PatternMatching.PatternMatchKind.Prefix => PatternMatchKind.Prefix, 87PatternMatching.PatternMatchKind.NonLowercaseSubstring => PatternMatchKind.Substring, 88PatternMatching.PatternMatchKind.StartOfWordSubstring => PatternMatchKind.Substring, 89PatternMatching.PatternMatchKind.CamelCaseExact => PatternMatchKind.CamelCaseExact, 90PatternMatching.PatternMatchKind.CamelCasePrefix => PatternMatchKind.CamelCasePrefix, 91PatternMatching.PatternMatchKind.CamelCaseNonContiguousPrefix => PatternMatchKind.CamelCaseNonContiguousPrefix, 92PatternMatching.PatternMatchKind.CamelCaseSubstring => PatternMatchKind.CamelCaseSubstring, 93PatternMatching.PatternMatchKind.CamelCaseNonContiguousSubstring => PatternMatchKind.CamelCaseNonContiguousSubstring, 94PatternMatching.PatternMatchKind.Fuzzy => PatternMatchKind.Fuzzy, 96PatternMatching.PatternMatchKind.LowercaseSubstring => PatternMatchKind.Fuzzy,