From e7cdffd8d4d1e9bcef34374966a128b01a63da94 Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Fri, 4 Jun 2021 18:53:46 +0800 Subject: [PATCH] fix: save tsEntry.data for resolveCompletionItem (#294) close #293 --- src/server/features/completionItemProvider.ts | 4 ++-- src/server/utils/completionItem.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/features/completionItemProvider.ts b/src/server/features/completionItemProvider.ts index ef914c7..49060fd 100644 --- a/src/server/features/completionItemProvider.ts +++ b/src/server/features/completionItemProvider.ts @@ -222,7 +222,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP ): Promise { if (item == null) return undefined - let { uri, position, source, name } = item.data + let { uri, position, source, name, data } = item.data const filepath = this.client.toPath(uri) if (!filepath) return undefined let document = workspace.getDocument(uri) @@ -232,7 +232,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP filepath, position ), - entryNames: [source ? { name, source } : name] + entryNames: [source ? { name, source, data } : name] } let response: ServerResponse.Response diff --git a/src/server/utils/completionItem.ts b/src/server/utils/completionItem.ts index 3100663..d6b4cbb 100644 --- a/src/server/utils/completionItem.ts +++ b/src/server/utils/completionItem.ts @@ -106,6 +106,7 @@ export function convertCompletionEntry( uri, position, name: tsEntry.name, + data: tsEntry.data, source: tsEntry.source || '' } }