Skip to content

Commit

Permalink
Don’t generate module specifiers for non-importable exportInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Feb 9, 2023
1 parent 605b0d9 commit 6c85f52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3443,8 +3443,8 @@ function getCompletionData(
// module resolution modes, getting past this point guarantees that we'll be
// able to generate a suitable module specifier, so we can safely show a completion,
// even if we defer computing the module specifier.
const firstImportableExportInfo = find(info, isImportableExportInfo);
if (!firstImportableExportInfo) {
info = filter(info, isImportableExportInfo);
if (!info.length) {
return;
}

Expand All @@ -3461,9 +3461,9 @@ function getCompletionData(
// it should be identical regardless of which one is used. During the subsequent
// `CompletionEntryDetails` request, we'll get all the ExportInfos again and pick
// the best one based on the module specifier it produces.
let exportInfo = firstImportableExportInfo, moduleSpecifier;
let exportInfo = info[0], moduleSpecifier;
if (result !== "skipped") {
({ exportInfo = firstImportableExportInfo, moduleSpecifier } = result);
({ exportInfo = info[0], moduleSpecifier } = result);
}

const isDefaultExport = exportInfo.exportKind === ExportKind.Default;
Expand Down

0 comments on commit 6c85f52

Please sign in to comment.