Fix bug: Get merged module symbol in forEachExternalModule (#24295)

This commit is contained in:
Andy 2018-05-21 10:48:50 -07:00 committed by GitHub
parent c09cc70ebe
commit 440291e316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 1 deletions

View file

@ -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);
}
}
}

View file

@ -0,0 +1,36 @@
/// <reference path="fourslash.ts" />
// @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,
},
});