From 7c81fc811901717fb95625bacfa99065f5b37b5a Mon Sep 17 00:00:00 2001 From: hikerpig Date: Wed, 4 Mar 2020 13:54:05 +0800 Subject: [PATCH] Follow user's config while resolving autoImport path, related #1177 --- server/src/modes/script/javascript.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/modes/script/javascript.ts b/server/src/modes/script/javascript.ts index f79f252916..337b062868 100644 --- a/server/src/modes/script/javascript.ts +++ b/server/src/modes/script/javascript.ts @@ -207,17 +207,15 @@ export async function getJavascriptMode( } const fileFsPath = getFileFsPath(doc.uri); + const userPrefs: ts.UserPreferences = + doc.languageId === 'javascript' ? config.javascript.preferences : config.typescript.preferences; const details = service.getCompletionEntryDetails( fileFsPath, item.data.offset, item.label, getFormatCodeSettings(config), item.data.source, - { - importModuleSpecifierEnding: 'minimal', - importModuleSpecifierPreference: 'relative', - includeCompletionsWithInsertText: true - } + userPrefs ); if (details && item.kind !== CompletionItemKind.File && item.kind !== CompletionItemKind.Folder) { item.detail = tsModule.displayPartsToString(details.displayParts);