From f619861921f76ebe7ee6957a08ad3c017cbb9b19 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Fri, 21 Apr 2023 09:10:15 +0200 Subject: [PATCH] Add 'data' to the list of item defaults for completion items. --- client/src/common/completion.ts | 2 +- testbed/server/src/server.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/common/completion.ts b/client/src/common/completion.ts index 79ffb7de9..d455571bd 100644 --- a/client/src/common/completion.ts +++ b/client/src/common/completion.ts @@ -91,7 +91,7 @@ export class CompletionItemFeature extends TextDocumentLanguageFeature | completionProvider: { triggerCharacters: ['.'], allCommitCharacters: [';'], - resolveProvider: false, + resolveProvider: true, }, signatureHelpProvider: { }, @@ -372,7 +372,7 @@ connection.languages.diagnostics.onWorkspace(async (params, token, _, resultProg return { items: [] }; }); -connection.onCompletion((params, token): CompletionItem[] => { +connection.onCompletion((params, token): CompletionList => { const result: CompletionItem[] = []; let item = CompletionItem.create('foo'); result.push(item); @@ -407,7 +407,9 @@ connection.onCompletion((params, token): CompletionItem[] => { item.kind = CompletionItemKind.Field; result.push(item); - return result; + const list = CompletionList.create(result, true); + list.itemDefaults = { data: 'abc' }; + return list; }); connection.onCompletionResolve((item): CompletionItem => {