Skip to content

Commit 20fd4dd

Browse files
author
Andy
committed
Merge pull request microsoft#8843 from Microsoft/navbar_type_alias
Include type aliases as childItems in navigation bar
2 parents 8aa6a9d + fdd5c06 commit 20fd4dd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/services/navigationBar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ namespace ts.NavigationBar {
104104
case SyntaxKind.ImportEqualsDeclaration:
105105
case SyntaxKind.ImportSpecifier:
106106
case SyntaxKind.ExportSpecifier:
107+
case SyntaxKind.TypeAliasDeclaration:
107108
childNodes.push(node);
108109
break;
109110
}
@@ -326,6 +327,8 @@ namespace ts.NavigationBar {
326327
case SyntaxKind.InterfaceDeclaration:
327328
return createItem(node, getTextOfNode((<InterfaceDeclaration>node).name), ts.ScriptElementKind.interfaceElement);
328329

330+
case SyntaxKind.TypeAliasDeclaration:
331+
return createItem(node, getTextOfNode((<TypeAliasDeclaration>node).name), ts.ScriptElementKind.typeElement);
329332

330333
case SyntaxKind.CallSignature:
331334
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);

tests/cases/fourslash/navigationBarItemsTypeAlias.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
////type T = number | string;
44

5-
verify.navigationBarCount(1);
5+
verify.navigationBarCount(3);
66
verify.navigationBarContains("T", "type");
7+
verify.navigationBarChildItem("<global>", "T", "type");

0 commit comments

Comments
 (0)