@@ -506,7 +506,7 @@ namespace ts.NavigationBar {
506506 function convertToTopLevelItem ( n : NavigationBarNode ) : NavigationBarItem {
507507 return {
508508 text : getItemName ( n . node ) ,
509- kind : nodeKind ( n . node ) ,
509+ kind : getNodeKind ( n . node ) ,
510510 kindModifiers : getNodeModifiers ( n . node ) ,
511511 spans : getSpans ( n ) ,
512512 childItems : map ( n . children , convertToChildItem ) || emptyChildItemArray ,
@@ -518,7 +518,7 @@ namespace ts.NavigationBar {
518518 function convertToChildItem ( n : NavigationBarNode ) : NavigationBarItem {
519519 return {
520520 text : getItemName ( n . node ) ,
521- kind : nodeKind ( n . node ) ,
521+ kind : getNodeKind ( n . node ) ,
522522 kindModifiers : getNodeModifiers ( n . node ) ,
523523 spans : getSpans ( n ) ,
524524 childItems : emptyChildItemArray ,
@@ -539,57 +539,6 @@ namespace ts.NavigationBar {
539539 }
540540 }
541541
542- // TODO: GH#9145: We should just use getNodeKind. No reason why navigationBar and navigateTo should have different behaviors.
543- function nodeKind ( node : Node ) : string {
544- switch ( node . kind ) {
545- case SyntaxKind . SourceFile :
546- return ScriptElementKind . moduleElement ;
547-
548- case SyntaxKind . EnumMember :
549- return ScriptElementKind . memberVariableElement ;
550-
551- case SyntaxKind . VariableDeclaration :
552- case SyntaxKind . BindingElement :
553- let variableDeclarationNode : Node ;
554- let name : Node ;
555-
556- if ( node . kind === SyntaxKind . BindingElement ) {
557- name = ( < BindingElement > node ) . name ;
558- variableDeclarationNode = node ;
559- // binding elements are added only for variable declarations
560- // bubble up to the containing variable declaration
561- while ( variableDeclarationNode && variableDeclarationNode . kind !== SyntaxKind . VariableDeclaration ) {
562- variableDeclarationNode = variableDeclarationNode . parent ;
563- }
564- Debug . assert ( ! ! variableDeclarationNode ) ;
565- }
566- else {
567- Debug . assert ( ! isBindingPattern ( ( < VariableDeclaration > node ) . name ) ) ;
568- variableDeclarationNode = node ;
569- name = ( < VariableDeclaration > node ) . name ;
570- }
571-
572- if ( isConst ( variableDeclarationNode ) ) {
573- return ts . ScriptElementKind . constElement ;
574- }
575- else if ( isLet ( variableDeclarationNode ) ) {
576- return ts . ScriptElementKind . letElement ;
577- }
578- else {
579- return ts . ScriptElementKind . variableElement ;
580- }
581-
582- case SyntaxKind . ArrowFunction :
583- return ts . ScriptElementKind . functionElement ;
584-
585- case SyntaxKind . JSDocTypedefTag :
586- return ScriptElementKind . typeElement ;
587-
588- default :
589- return getNodeKind ( node ) ;
590- }
591- }
592-
593542 function getModuleName ( moduleDeclaration : ModuleDeclaration ) : string {
594543 // We want to maintain quotation marks.
595544 if ( isAmbientModule ( moduleDeclaration ) ) {
0 commit comments