File tree 3 files changed +115
-5
lines changed 3 files changed +115
-5
lines changed Original file line number Diff line number Diff line change @@ -310,9 +310,11 @@ namespace ts.NavigationBar {
310
310
311
311
case SyntaxKind . ExportAssignment : {
312
312
const expression = ( < ExportAssignment > node ) . expression ;
313
- if ( isObjectLiteralExpression ( expression ) ) {
313
+ const child = isObjectLiteralExpression ( expression ) ? expression :
314
+ isArrowFunction ( expression ) || isFunctionExpression ( expression ) ? expression . body : undefined ;
315
+ if ( child ) {
314
316
startNode ( node ) ;
315
- addChildrenRecursively ( expression ) ;
317
+ addChildrenRecursively ( child ) ;
316
318
endNode ( ) ;
317
319
}
318
320
else {
Original file line number Diff line number Diff line change 1
1
/// <reference path="fourslash.ts"/>
2
2
3
- //// const abc = 12;
4
3
//// export default function () {}
4
+ //// export default function () {
5
+ //// return class Foo {
6
+ //// }
7
+ //// }
8
+ ////
5
9
//// export default () => ""
10
+ //// export default () => {
11
+ //// return class Foo {
12
+ //// }
13
+ //// }
14
+ ////
15
+ //// export default function f1() {}
16
+ //// export default function f2() {
17
+ //// return class Foo {
18
+ //// }
19
+ //// }
20
+ ////
21
+ //// const abc = 12;
6
22
//// export default abc;
7
23
//// export default class AB {}
8
24
//// export default {
@@ -22,11 +38,33 @@ verify.navigationTree({
22
38
"kind" : "function" ,
23
39
"kindModifiers" : "export"
24
40
} ,
41
+ {
42
+ "text" : "default" ,
43
+ "kind" : "function" ,
44
+ "kindModifiers" : "export" ,
45
+ "childItems" : [
46
+ {
47
+ "text" : "Foo" ,
48
+ "kind" : "class"
49
+ }
50
+ ]
51
+ } ,
25
52
{
26
53
"text" : "default" ,
27
54
"kind" : "function" ,
28
55
"kindModifiers" : "export"
29
56
} ,
57
+ {
58
+ "text" : "default" ,
59
+ "kind" : "function" ,
60
+ "kindModifiers" : "export" ,
61
+ "childItems" : [
62
+ {
63
+ "text" : "Foo" ,
64
+ "kind" : "class"
65
+ }
66
+ ]
67
+ } ,
30
68
{
31
69
"text" : "default" ,
32
70
"kind" : "const" ,
@@ -65,6 +103,22 @@ verify.navigationTree({
65
103
"text" : "default" ,
66
104
"kind" : "const" ,
67
105
"kindModifiers" : "export"
106
+ } ,
107
+ {
108
+ "text" : "f1" ,
109
+ "kind" : "function" ,
110
+ "kindModifiers" : "export"
111
+ } ,
112
+ {
113
+ "text" : "f2" ,
114
+ "kind" : "function" ,
115
+ "kindModifiers" : "export" ,
116
+ "childItems" : [
117
+ {
118
+ "text" : "Foo" ,
119
+ "kind" : "class"
120
+ }
121
+ ]
68
122
}
69
123
]
70
124
} ) ;
Original file line number Diff line number Diff line change 1
1
// 35477
2
2
/// <reference path="fourslash.ts"/>
3
3
4
- //// const abc = 12;
5
- //// export = abc;
6
4
//// export = function () {}
5
+ //// export = function () {
6
+ //// return class Foo {
7
+ //// }
8
+ //// }
9
+ ////
7
10
//// export = () => ""
11
+ //// export = () => {
12
+ //// return class Foo {
13
+ //// }
14
+ //// }
15
+ ////
16
+ //// export = function f1() {}
17
+ //// export = function f2() {
18
+ //// return class Foo {
19
+ //// }
20
+ //// }
21
+ ////
22
+ //// const abc = 12;
23
+ //// export = abc;
8
24
//// export = class AB {}
9
25
//// export = {
10
26
//// a: 1,
@@ -23,11 +39,49 @@ verify.navigationTree({
23
39
"kind" : "function" ,
24
40
"kindModifiers" : "export"
25
41
} ,
42
+ {
43
+ "text" : "export=" ,
44
+ "kind" : "function" ,
45
+ "kindModifiers" : "export" ,
46
+ "childItems" : [
47
+ {
48
+ "text" : "Foo" ,
49
+ "kind" : "class"
50
+ }
51
+ ]
52
+ } ,
53
+ {
54
+ "text" : "export=" ,
55
+ "kind" : "function" ,
56
+ "kindModifiers" : "export"
57
+ } ,
58
+ {
59
+ "text" : "export=" ,
60
+ "kind" : "function" ,
61
+ "kindModifiers" : "export" ,
62
+ "childItems" : [
63
+ {
64
+ "text" : "Foo" ,
65
+ "kind" : "class"
66
+ }
67
+ ]
68
+ } ,
26
69
{
27
70
"text" : "export=" ,
28
71
"kind" : "function" ,
29
72
"kindModifiers" : "export"
30
73
} ,
74
+ {
75
+ "text" : "export=" ,
76
+ "kind" : "function" ,
77
+ "kindModifiers" : "export" ,
78
+ "childItems" : [
79
+ {
80
+ "text" : "Foo" ,
81
+ "kind" : "class"
82
+ }
83
+ ]
84
+ } ,
31
85
{
32
86
"text" : "export=" ,
33
87
"kind" : "class" ,
You can’t perform that action at this time.
0 commit comments