提交 76e60a46 编写于 作者: J Johannes Rieken

add heuristic for label highlights when only filterText but not the label matches, fixes #11466

上级 258cd9d0
...@@ -138,7 +138,13 @@ export class CompletionModel { ...@@ -138,7 +138,13 @@ export class CompletionModel {
// no match on label nor codeSnippet -> check on filterText // no match on label nor codeSnippet -> check on filterText
if(!match && typeof suggestion.filterText === 'string') { if(!match && typeof suggestion.filterText === 'string') {
match = !isFalsyOrEmpty(filter(word, suggestion.filterText)); if (!isFalsyOrEmpty(filter(word, suggestion.filterText))) {
match = true;
// try to compute highlights by stripping none-word
// characters from the end of the string
item.highlights = filter(word.replace(/^\W+|\W+$/, ''), suggestion.label);
}
} }
if (!match) { if (!match) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册