提交 d13f20e0 编写于 作者: J Johannes Rieken

filter - use matchesFuzzy2 for quick outline and workspace symbols

上级 ff630f90
......@@ -343,8 +343,12 @@ export function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSep
return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);
}
export function matchesFuzzy2(word: string, wordToMatchAgainst: string): IMatch[] | null {
let score = fuzzyScore(word, word.toLowerCase(), 0, wordToMatchAgainst, wordToMatchAgainst.toLowerCase(), 0, false);
/**
* Match pattern againt word in a fuzzy way. As in IntelliSense and faster and more
* powerfull than `matchesFuzzy`
*/
export function matchesFuzzy2(pattern: string, word: string): IMatch[] | null {
let score = fuzzyScore(pattern, pattern.toLowerCase(), 0, word, word.toLowerCase(), 0, false);
return score ? createMatches(score) : null;
}
......
......@@ -89,7 +89,7 @@ class OutlineModel extends QuickOpenModel {
// Filter by search
if (normalizedSearchValue) {
const highlights = filters.matchesFuzzy(normalizedSearchValue, entry.getLabel());
const highlights = filters.matchesFuzzy2(normalizedSearchValue, entry.getLabel());
if (highlights) {
entry.setHighlights(highlights);
entry.setHidden(false);
......
......@@ -206,7 +206,7 @@ export class OpenSymbolHandler extends QuickOpenHandler {
}
const entry = this.instantiationService.createInstance(SymbolEntry, element, provider);
entry.setHighlights(filters.matchesFuzzy(searchValue, entry.getLabel()));
entry.setHighlights(filters.matchesFuzzy2(searchValue, entry.getLabel()));
bucket.push(entry);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册