Skip to content

Commit 0d781d8

Browse files
committed
addressed CR feedback
1 parent 92dddd0 commit 0d781d8

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2765,7 +2765,7 @@ module ts {
27652765
return emptyArray;
27662766
}
27672767

2768-
return mapToArray(module.exports)
2768+
return mapToArray(getExportsOfModule(module))
27692769
}
27702770

27712771
function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature {

src/services/services.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,7 @@ module ts {
24082408
// try to show exported member for imported module
24092409
isMemberCompletion = true;
24102410
isNewIdentifierLocation = true;
2411-
if (canShowCompletionInImportsClause(previousToken)) {
2411+
if (showCompletionsInImportsClause(previousToken)) {
24122412
var importDeclaration = <ImportDeclaration>getAncestor(previousToken, SyntaxKind.ImportDeclaration);
24132413
Debug.assert(importDeclaration !== undefined);
24142414
var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration);
@@ -2466,11 +2466,13 @@ module ts {
24662466
return result;
24672467
}
24682468

2469-
function canShowCompletionInImportsClause(node: Node): boolean {
2470-
// import {|
2471-
// import {a,|
2472-
if (node.kind === SyntaxKind.OpenBraceToken || node.kind === SyntaxKind.CommaToken) {
2473-
return node.parent.kind === SyntaxKind.NamedImports;
2469+
function showCompletionsInImportsClause(node: Node): boolean {
2470+
if (node) {
2471+
// import {|
2472+
// import {a,|
2473+
if (node.kind === SyntaxKind.OpenBraceToken || node.kind === SyntaxKind.CommaToken) {
2474+
return node.parent.kind === SyntaxKind.NamedImports;
2475+
}
24742476
}
24752477

24762478
return false;
@@ -2687,17 +2689,13 @@ module ts {
26872689
return false;
26882690
}
26892691

2690-
function filterModuleExports(exports: Symbol[], importDeclaration: ImportDeclaration): Symbol[]{
2692+
function filterModuleExports(exports: Symbol[], importDeclaration: ImportDeclaration): Symbol[] {
26912693
var exisingImports: Map<boolean> = {};
26922694

26932695
if (!importDeclaration.importClause) {
26942696
return exports;
26952697
}
26962698

2697-
if (importDeclaration.importClause.name) {
2698-
exisingImports[importDeclaration.importClause.name.text] = true;
2699-
}
2700-
27012699
if (importDeclaration.importClause.namedBindings &&
27022700
importDeclaration.importClause.namedBindings.kind === SyntaxKind.NamedImports) {
27032701

@@ -2710,9 +2708,7 @@ module ts {
27102708
if (isEmpty(exisingImports)) {
27112709
return exports;
27122710
}
2713-
else {
2714-
return filter(exports, e => !lookUp(exisingImports, e.name));
2715-
}
2711+
return filter(exports, e => !lookUp(exisingImports, e.name));
27162712
}
27172713

27182714
function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] {

0 commit comments

Comments
 (0)