mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
Avoid setting completion items as undefined
This commit is contained in:
@@ -215,8 +215,8 @@ connection.onCompletion(textDocumentPosition => {
|
||||
|
||||
cachedCompletionList = null;
|
||||
let emmetCompletionList: CompletionList = {
|
||||
isIncomplete: true,
|
||||
items: undefined
|
||||
isIncomplete: false,
|
||||
items: []
|
||||
};
|
||||
const emmetCompletionParticipant: ICompletionParticipant = getEmmetCompletionParticipants(document, textDocumentPosition.position, document.languageId, emmetSettings, emmetCompletionList);
|
||||
getLanguageService(document).setCompletionParticipants([emmetCompletionParticipant]);
|
||||
@@ -227,7 +227,7 @@ connection.onCompletion(textDocumentPosition => {
|
||||
if (emmetCompletionList.items.length && hexColorRegex.test(emmetCompletionList.items[0].label) && result.items.some(x => x.label === emmetCompletionList.items[0].label)) {
|
||||
emmetCompletionList.items.shift();
|
||||
}
|
||||
return { isIncomplete: true, items: [...emmetCompletionList.items, ...result.items] };
|
||||
return { isIncomplete: emmetCompletionList.isIncomplete || result.isIncomplete, items: [...emmetCompletionList.items, ...result.items] };
|
||||
}
|
||||
return result;
|
||||
}, null, `Error while computing completions for ${textDocumentPosition.textDocument.uri}`);
|
||||
|
||||
Reference in New Issue
Block a user