@@ -50,6 +50,38 @@ module ts.NavigationBar {
5050 case SyntaxKind . ArrayBindingPattern :
5151 forEach ( ( < BindingPattern > node ) . elements , visit ) ;
5252 break ;
53+
54+ case SyntaxKind . ExportDeclaration :
55+ // Handle named exports case e.g.:
56+ // export {a, b as B} from "mod";
57+ if ( ( < ExportDeclaration > node ) . exportClause ) {
58+ forEach ( ( < ExportDeclaration > node ) . exportClause . elements , visit ) ;
59+ }
60+ break ;
61+
62+ case SyntaxKind . ImportDeclaration :
63+ var importClause = ( < ImportDeclaration > node ) . importClause ;
64+ if ( importClause ) {
65+ // Handle default import case e.g.:
66+ // import d from "mod";
67+ if ( importClause . name ) {
68+ childNodes . push ( importClause ) ;
69+ }
70+
71+ // Handle named bindings in imports e.g.:
72+ // import * as NS from "mod";
73+ // import {a, b as B} from "mod";
74+ if ( importClause . namedBindings ) {
75+ if ( importClause . namedBindings . kind === SyntaxKind . NamespaceImport ) {
76+ childNodes . push ( importClause . namedBindings ) ;
77+ }
78+ else {
79+ forEach ( ( < NamedImports > importClause . namedBindings ) . elements , visit ) ;
80+ }
81+ }
82+ }
83+ break ;
84+
5385 case SyntaxKind . BindingElement :
5486 case SyntaxKind . VariableDeclaration :
5587 if ( isBindingPattern ( ( < VariableDeclaration > node ) . name ) ) {
@@ -62,7 +94,11 @@ module ts.NavigationBar {
6294 case SyntaxKind . InterfaceDeclaration :
6395 case SyntaxKind . ModuleDeclaration :
6496 case SyntaxKind . FunctionDeclaration :
97+ case SyntaxKind . ImportEqualsDeclaration :
98+ case SyntaxKind . ImportSpecifier :
99+ case SyntaxKind . ExportSpecifier :
65100 childNodes . push ( node ) ;
101+ break ;
66102 }
67103 }
68104
@@ -291,9 +327,16 @@ module ts.NavigationBar {
291327 else {
292328 return createItem ( node , getTextOfNode ( name ) , ts . ScriptElementKind . variableElement ) ;
293329 }
294-
330+
295331 case SyntaxKind . Constructor :
296332 return createItem ( node , "constructor" , ts . ScriptElementKind . constructorImplementationElement ) ;
333+
334+ case SyntaxKind . ExportSpecifier :
335+ case SyntaxKind . ImportSpecifier :
336+ case SyntaxKind . ImportEqualsDeclaration :
337+ case SyntaxKind . ImportClause :
338+ case SyntaxKind . NamespaceImport :
339+ return createItem ( node , getTextOfNode ( ( < Declaration > node ) . name ) , ts . ScriptElementKind . alias ) ;
297340 }
298341
299342 return undefined ;
0 commit comments