@@ -2408,7 +2408,7 @@ module ts {
2408
2408
// try to show exported member for imported module
2409
2409
isMemberCompletion = true ;
2410
2410
isNewIdentifierLocation = true ;
2411
- if ( canShowCompletionInImportsClause ( previousToken ) ) {
2411
+ if ( showCompletionsInImportsClause ( previousToken ) ) {
2412
2412
var importDeclaration = < ImportDeclaration > getAncestor ( previousToken , SyntaxKind . ImportDeclaration ) ;
2413
2413
Debug . assert ( importDeclaration !== undefined ) ;
2414
2414
var exports = typeInfoResolver . getExportsOfExternalModule ( importDeclaration ) ;
@@ -2466,11 +2466,13 @@ module ts {
2466
2466
return result ;
2467
2467
}
2468
2468
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
+ }
2474
2476
}
2475
2477
2476
2478
return false ;
@@ -2687,17 +2689,13 @@ module ts {
2687
2689
return false ;
2688
2690
}
2689
2691
2690
- function filterModuleExports ( exports : Symbol [ ] , importDeclaration : ImportDeclaration ) : Symbol [ ] {
2692
+ function filterModuleExports ( exports : Symbol [ ] , importDeclaration : ImportDeclaration ) : Symbol [ ] {
2691
2693
var exisingImports : Map < boolean > = { } ;
2692
2694
2693
2695
if ( ! importDeclaration . importClause ) {
2694
2696
return exports ;
2695
2697
}
2696
2698
2697
- if ( importDeclaration . importClause . name ) {
2698
- exisingImports [ importDeclaration . importClause . name . text ] = true ;
2699
- }
2700
-
2701
2699
if ( importDeclaration . importClause . namedBindings &&
2702
2700
importDeclaration . importClause . namedBindings . kind === SyntaxKind . NamedImports ) {
2703
2701
@@ -2710,9 +2708,7 @@ module ts {
2710
2708
if ( isEmpty ( exisingImports ) ) {
2711
2709
return exports ;
2712
2710
}
2713
- else {
2714
- return filter ( exports , e => ! lookUp ( exisingImports , e . name ) ) ;
2715
- }
2711
+ return filter ( exports , e => ! lookUp ( exisingImports , e . name ) ) ;
2716
2712
}
2717
2713
2718
2714
function filterContextualMembersList ( contextualMemberSymbols : Symbol [ ] , existingMembers : Declaration [ ] ) : Symbol [ ] {
0 commit comments