diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index d30e2a2cf6..eaa0a7c061 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -498,7 +498,7 @@ namespace ts.codefix { } for (const sourceFile of allSourceFiles) { if (isExternalOrCommonJsModule(sourceFile)) { - cb(sourceFile.symbol, sourceFile); + cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); } } } diff --git a/tests/cases/fourslash/completionsImport_augmentation.ts b/tests/cases/fourslash/completionsImport_augmentation.ts new file mode 100644 index 0000000000..701af24537 --- /dev/null +++ b/tests/cases/fourslash/completionsImport_augmentation.ts @@ -0,0 +1,36 @@ +/// + +// @Filename: /a.ts +////export const foo = 0; + +// @Filename: /bar.ts +////export {}; +////declare module "./a" { +//// export const bar = 0; +////} + +// @Filename: /user.ts +/////**/ + +verify.completions({ + marker: "", + includes: [ + { + name: "foo", + text: "const foo: 0", + source: "/a", + sourceDisplay: "./a", + hasAction: true, + }, + { + name: "bar", + text: "const bar: 0", + source: "/a", + sourceDisplay: "./a", + hasAction: true, + }, + ], + preferences: { + includeCompletionsForModuleExports: true, + }, +});