mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 00:34:47 -05:00
This commit is contained in:
@@ -628,7 +628,7 @@ namespace ts.Completions {
|
||||
}
|
||||
|
||||
const { moduleSymbol } = symbolOriginInfo;
|
||||
const exportedSymbol = skipAlias(symbol.exportSymbol || symbol, checker);
|
||||
const exportedSymbol = checker.getMergedSymbol(skipAlias(symbol.exportSymbol || symbol, checker));
|
||||
const { moduleSpecifier, codeAction } = codefix.getImportCompletionAction(
|
||||
exportedSymbol,
|
||||
moduleSymbol,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @module: esnext
|
||||
|
||||
// @Filename: /a.ts
|
||||
////declare module "m" {
|
||||
//// export default class M {}
|
||||
////}
|
||||
|
||||
// @Filename: /b.ts
|
||||
////declare module "m" {
|
||||
//// export default interface M {}
|
||||
////}
|
||||
|
||||
// @Filename: /c.ts
|
||||
/////**/
|
||||
|
||||
goTo.marker("");
|
||||
verify.completionListContains({ name: "M", source: "m" }, "class M", "", "class", /*spanIndex*/ undefined, /*hasAction*/ true, {
|
||||
includeCompletionsForModuleExports: true,
|
||||
sourceDisplay: "m",
|
||||
});
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "M",
|
||||
source: "m",
|
||||
description: `Import 'M' from module "m"`,
|
||||
newFileContent: `import M from "m";
|
||||
|
||||
`,
|
||||
});
|
||||
Reference in New Issue
Block a user