diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dfe6317e250..a1a8ae0da5c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1465,6 +1465,10 @@ namespace ts { function getExportsForModule(moduleSymbol: Symbol): SymbolTable { const visitedSymbols: Symbol[] = []; + + // A module defined by an 'export=' consists on one export that needs to be resolved + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + return visit(moduleSymbol) || moduleSymbol.exports; // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, @@ -17889,7 +17893,8 @@ namespace ts { } function isNotOverload(declaration: Declaration): boolean { - return declaration.kind !== SyntaxKind.FunctionDeclaration || !!(declaration as FunctionDeclaration).body; + return (declaration.kind !== SyntaxKind.FunctionDeclaration && declaration.kind !== SyntaxKind.MethodDeclaration) || + !!(declaration as FunctionDeclaration).body; } } diff --git a/tests/cases/fourslash/completionListInImportClause04.ts b/tests/cases/fourslash/completionListInImportClause04.ts new file mode 100644 index 00000000000..672c754e807 --- /dev/null +++ b/tests/cases/fourslash/completionListInImportClause04.ts @@ -0,0 +1,20 @@ +/// + +// @Filename: foo.d.ts +//// declare class Foo { +//// static prop1(x: number): number; +//// static prop1(x: string): string; +//// static prop2(x: boolean): boolean; +//// } +//// export = Foo; /*2*/ + +// @Filename: app.ts +////import {/*1*/} from './foo'; + +goTo.marker('1'); +verify.completionListContains('prop1'); +verify.completionListContains('prop2'); +verify.not.completionListContains('Foo'); +verify.numberOfErrorsInCurrentFile(0); +goTo.marker('2'); +verify.numberOfErrorsInCurrentFile(0);