Skip to content

Commit

Permalink
Follow user's config while resolving autoImport path, related vuejs#1177
Browse files Browse the repository at this point in the history
  • Loading branch information
hikerpig committed Mar 4, 2020
1 parent dda908d commit 7c81fc8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/src/modes/script/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7c81fc8

Please sign in to comment.