提交 e6454e6c 编写于 作者: M Matt Bierner

Add workaround some completions unit tests failing with null access exceptions

上级 cd1eb20d
......@@ -222,16 +222,16 @@ export class CompletionModel {
// if it matches we check with the label to compute highlights
// and if that doesn't yield a result we have no highlights,
// despite having the match
let match = scoreFn(word, wordLow, wordPos, suggestion.filterText, suggestion._filterTextLow, 0, false);
let match = scoreFn(word, wordLow, wordPos, suggestion.filterText, typeof suggestion._filterTextLow === 'undefined' && suggestion.filterText ? suggestion.filterText.toLowerCase() : suggestion._filterTextLow, 0, false);
if (!match) {
continue;
}
item.score = match[0];
item.matches = (fuzzyScore(word, wordLow, 0, suggestion.label, suggestion._labelLow, 0, true) || anyScore(word, suggestion.label))[1];
item.matches = (fuzzyScore(word, wordLow, 0, suggestion.label, typeof suggestion._labelLow === 'undefined' ? suggestion.label.toLowerCase() : suggestion._labelLow, 0, true) || anyScore(word, suggestion.label))[1];
} else {
// by default match `word` against the `label`
let match = scoreFn(word, wordLow, wordPos, suggestion.label, suggestion._labelLow, 0, false);
let match = scoreFn(word, wordLow, wordPos, suggestion.label, typeof suggestion._labelLow === 'undefined' ? suggestion.label.toLowerCase() : suggestion._labelLow, 0, false);
if (match) {
item.score = match[0];
item.matches = match[1];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册