Skip to content

Commit 440291e

Browse files
author
Andy
authored
Fix bug: Get merged module symbol in forEachExternalModule (microsoft#24295)
1 parent c09cc70 commit 440291e

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/services/codefixes/importFixes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ namespace ts.codefix {
498498
}
499499
for (const sourceFile of allSourceFiles) {
500500
if (isExternalOrCommonJsModule(sourceFile)) {
501-
cb(sourceFile.symbol, sourceFile);
501+
cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);
502502
}
503503
}
504504
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /a.ts
4+
////export const foo = 0;
5+
6+
// @Filename: /bar.ts
7+
////export {};
8+
////declare module "./a" {
9+
//// export const bar = 0;
10+
////}
11+
12+
// @Filename: /user.ts
13+
/////**/
14+
15+
verify.completions({
16+
marker: "",
17+
includes: [
18+
{
19+
name: "foo",
20+
text: "const foo: 0",
21+
source: "/a",
22+
sourceDisplay: "./a",
23+
hasAction: true,
24+
},
25+
{
26+
name: "bar",
27+
text: "const bar: 0",
28+
source: "/a",
29+
sourceDisplay: "./a",
30+
hasAction: true,
31+
},
32+
],
33+
preferences: {
34+
includeCompletionsForModuleExports: true,
35+
},
36+
});

0 commit comments

Comments
 (0)