Add exports of current module to getSymbolsInScope (#28442)

This commit is contained in:
Andy
2018-11-09 12:48:10 -08:00
committed by GitHub
parent b48c2b295d
commit c0e5c80e53
2 changed files with 21 additions and 1 deletions

View File

@@ -27698,8 +27698,11 @@ namespace ts {
}
switch (location.kind) {
case SyntaxKind.SourceFile:
if (!isExternalOrCommonJsModule(<SourceFile>location)) break;
// falls through
case SyntaxKind.ModuleDeclaration:
copySymbols(getSymbolOfNode(location as ModuleDeclaration).exports!, meaning & SymbolFlags.ModuleMember);
copySymbols(getSymbolOfNode(location as ModuleDeclaration | SourceFile).exports!, meaning & SymbolFlags.ModuleMember);
break;
case SyntaxKind.EnumDeclaration:
copySymbols(getSymbolOfNode(location as EnumDeclaration).exports!, meaning & SymbolFlags.EnumMember);

View File

@@ -0,0 +1,17 @@
/// <reference path="fourslash.ts" />
////declare global {
//// namespace N {
//// const foo: number;
//// }
////}
////export import foo = N.foo;
/////**/
verify.completions({
marker: "",
exact: [
{ name: "foo", kind: "alias", kindModifiers: "export", text: "(alias) const foo: number\nimport foo = N.foo" },
...completion.globalsPlus([{ name: "N", kind: "module", kindModifiers: "declare", text: "namespace N" }]),
],
});