File tree 2 files changed +59
-1
lines changed
2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -648,7 +648,8 @@ namespace ts.NavigationBar {
648
648
649
649
const declName = getNameOfDeclaration ( < Declaration > node ) ;
650
650
if ( declName && isPropertyName ( declName ) ) {
651
- return unescapeLeadingUnderscores ( getPropertyNameForPropertyNameNode ( declName ) ! ) ; // TODO: GH#18217
651
+ const propertyName = getPropertyNameForPropertyNameNode ( declName ) ;
652
+ return propertyName && unescapeLeadingUnderscores ( propertyName ) ;
652
653
}
653
654
switch ( node . kind ) {
654
655
case SyntaxKind . FunctionExpression :
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts"/>
2
+
3
+ ////function F(key, value) {
4
+ //// return {
5
+ //// [key]: value,
6
+ //// "prop": true
7
+ //// }
8
+ //// }
9
+
10
+ verify . navigationTree ( {
11
+ "text" : "<global>" ,
12
+ "kind" : "script" ,
13
+ "childItems" : [
14
+ {
15
+ "text" : "F" ,
16
+ "kind" : "function" ,
17
+ "childItems" : [
18
+ {
19
+ "text" : "[key]" ,
20
+ "kind" : "property"
21
+ } ,
22
+ {
23
+ "text" : "\"prop\"" ,
24
+ "kind" : "property"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ } ) ;
30
+
31
+ verify . navigationBar ( [
32
+ {
33
+ "text" : "<global>" ,
34
+ "kind" : "script" ,
35
+ "childItems" : [
36
+ {
37
+ "text" : "F" ,
38
+ "kind" : "function"
39
+ }
40
+ ]
41
+ } ,
42
+ {
43
+ "text" : "F" ,
44
+ "kind" : "function" ,
45
+ "childItems" : [
46
+ {
47
+ "text" : "[key]" ,
48
+ "kind" : "property"
49
+ } ,
50
+ {
51
+ "text" : "\"prop\"" ,
52
+ "kind" : "property"
53
+ }
54
+ ] ,
55
+ "indent" : 1
56
+ }
57
+ ] ) ;
You can’t perform that action at this time.
0 commit comments