File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ namespace ts.NavigationBar {
310
310
311
311
case SyntaxKind . ExportAssignment : {
312
312
const expression = ( < ExportAssignment > node ) . expression ;
313
- const child = isObjectLiteralExpression ( expression ) ? expression :
313
+ const child = isObjectLiteralExpression ( expression ) || isCallExpression ( expression ) ? expression :
314
314
isArrowFunction ( expression ) || isFunctionExpression ( expression ) ? expression . body : undefined ;
315
315
if ( child ) {
316
316
startNode ( node ) ;
@@ -843,16 +843,11 @@ namespace ts.NavigationBar {
843
843
}
844
844
845
845
// Otherwise, we need to aggregate each identifier to build up the qualified name.
846
- const result : string [ ] = [ ] ;
847
-
848
- result . push ( getTextOfIdentifierOrLiteral ( moduleDeclaration . name ) ) ;
849
-
846
+ const result = [ getTextOfIdentifierOrLiteral ( moduleDeclaration . name ) ] ;
850
847
while ( moduleDeclaration . body && moduleDeclaration . body . kind === SyntaxKind . ModuleDeclaration ) {
851
848
moduleDeclaration = < ModuleDeclaration > moduleDeclaration . body ;
852
-
853
849
result . push ( getTextOfIdentifierOrLiteral ( moduleDeclaration . name ) ) ;
854
850
}
855
-
856
851
return result . join ( "." ) ;
857
852
}
858
853
Original file line number Diff line number Diff line change 28
28
//// d: 1
29
29
//// }
30
30
//// }
31
+ ////
32
+ //// function foo(props: { x: number; y: number }) {}
33
+ //// export default foo({ x: 1, y: 1 });
31
34
32
35
verify . navigationTree ( {
33
36
"text" : '"navigationItemsExportDefaultExpression"' ,
@@ -90,6 +93,21 @@ verify.navigationTree({
90
93
}
91
94
]
92
95
} ,
96
+ {
97
+ "text" : "default" ,
98
+ "kind" : "const" ,
99
+ "kindModifiers" : "export" ,
100
+ "childItems" : [
101
+ {
102
+ "text" : "x" ,
103
+ "kind" : "property"
104
+ } ,
105
+ {
106
+ "text" : "y" ,
107
+ "kind" : "property"
108
+ }
109
+ ]
110
+ } ,
93
111
{
94
112
"text" : "AB" ,
95
113
"kind" : "class" ,
@@ -119,6 +137,10 @@ verify.navigationTree({
119
137
"kind" : "class"
120
138
}
121
139
]
140
+ } ,
141
+ {
142
+ "text" : "foo" ,
143
+ "kind" : "function"
122
144
}
123
145
]
124
146
} ) ;
You can’t perform that action at this time.
0 commit comments