Merge pull request #11511 from Microsoft/FixImportListCompletions

Resolve export= module members
This commit is contained in:
Bill Ticehurst
2016-10-12 10:48:35 -07:00
committed by GitHub
2 changed files with 26 additions and 1 deletions
+6 -1
View File
@@ -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;
}
}
@@ -0,0 +1,20 @@
/// <reference path='fourslash.ts' />
// @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);