File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ namespace ts.NavigationBar {
176176 break ;
177177 case SyntaxKind . EnumDeclaration :
178178 case SyntaxKind . InterfaceDeclaration :
179+ case SyntaxKind . TypeAliasDeclaration :
179180 topLevelNodes . push ( node ) ;
180181 break ;
181182
@@ -422,6 +423,9 @@ namespace ts.NavigationBar {
422423
423424 case SyntaxKind . FunctionDeclaration :
424425 return createFunctionItem ( < FunctionDeclaration > node ) ;
426+
427+ case SyntaxKind . TypeAliasDeclaration :
428+ return createTypeAliasItem ( < TypeAliasDeclaration > node ) ;
425429 }
426430
427431 return undefined ;
@@ -474,6 +478,15 @@ namespace ts.NavigationBar {
474478 return undefined ;
475479 }
476480
481+ function createTypeAliasItem ( node : TypeAliasDeclaration ) : ts . NavigationBarItem {
482+ return getNavigationBarItem ( node . name . text ,
483+ ts . ScriptElementKind . typeElement ,
484+ getNodeModifiers ( node ) ,
485+ [ getNodeSpan ( node ) ] ,
486+ [ ] ,
487+ getIndent ( node ) ) ;
488+ }
489+
477490 function createMemberFunctionLikeItem ( node : MethodDeclaration | ConstructorDeclaration ) : ts . NavigationBarItem {
478491 if ( node . body && node . body . kind === SyntaxKind . Block ) {
479492 let childItems = getItemsWorker ( sortNodes ( ( < Block > node . body ) . statements ) , createChildItem ) ;
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts"/>
2+
3+ ////type T = number | string;
4+
5+ verify . navigationBarCount ( 1 ) ;
6+ verify . navigationBarContains ( "T" , "type" ) ;
You can’t perform that action at this time.
0 commit comments