iterate over suggestions only once, #95324
This commit is contained in:
parent
8f1b2e5657
commit
d1dfa5e91b
1 changed files with 6 additions and 3 deletions
|
@ -535,9 +535,12 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
|
||||||
useFuzzyWordRangeLogic: this.client.apiVersion.lt(API.v390),
|
useFuzzyWordRangeLogic: this.client.apiVersion.lt(API.v390),
|
||||||
};
|
};
|
||||||
|
|
||||||
const items = entries
|
const items: vscode.CompletionItem[] = [];
|
||||||
.filter(entry => !shouldExcludeCompletionEntry(entry, completionConfiguration))
|
for (let entry of entries) {
|
||||||
.map(entry => new MyCompletionItem(position, document, entry, completionContext, metadata));
|
if (!shouldExcludeCompletionEntry(entry, completionConfiguration)) {
|
||||||
|
items.push(new MyCompletionItem(position, document, entry, completionContext, metadata));
|
||||||
|
}
|
||||||
|
}
|
||||||
return new vscode.CompletionList(items, isIncomplete);
|
return new vscode.CompletionList(items, isIncomplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue