File tree Expand file tree Collapse file tree 3 files changed +61
-1
lines changed Expand file tree Collapse file tree 3 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,24 @@ namespace ts.NavigationBar {
269
269
addLeafNode ( node ) ;
270
270
break ;
271
271
272
+ case SyntaxKind . BinaryExpression : {
273
+ const special = getSpecialPropertyAssignmentKind ( node as BinaryExpression ) ;
274
+ switch ( special ) {
275
+ case SpecialPropertyAssignmentKind . ExportsProperty :
276
+ case SpecialPropertyAssignmentKind . ModuleExports :
277
+ case SpecialPropertyAssignmentKind . PrototypeProperty :
278
+ addNodeWithRecursiveChild ( node , ( node as BinaryExpression ) . right ) ;
279
+ break ;
280
+ case SpecialPropertyAssignmentKind . ThisProperty :
281
+ case SpecialPropertyAssignmentKind . Property :
282
+ case SpecialPropertyAssignmentKind . None :
283
+ break ;
284
+ default :
285
+ Debug . assertNever ( special ) ;
286
+ }
287
+ }
288
+ // falls through
289
+
272
290
default :
273
291
if ( hasJSDocNodes ( node ) ) {
274
292
forEach ( node . jsDoc , jsDoc => {
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ namespace ts {
364
364
const rightKind = getNodeKind ( right ) ;
365
365
return rightKind === ScriptElementKind . unknown ? ScriptElementKind . constElement : rightKind ;
366
366
case SpecialPropertyAssignmentKind . PrototypeProperty :
367
- return ScriptElementKind . memberFunctionElement ; // instance method
367
+ return isFunctionExpression ( right ) ? ScriptElementKind . memberFunctionElement : ScriptElementKind . memberVariableElement ;
368
368
case SpecialPropertyAssignmentKind . ThisProperty :
369
369
return ScriptElementKind . memberVariableElement ; // property
370
370
case SpecialPropertyAssignmentKind . Property :
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts"/>
2
+
3
+ // @Filename : foo.js
4
+ ////function f() {}
5
+ ////f.prototype.x = 0;
6
+
7
+ verify . navigationTree ( {
8
+ "text" : "<global>" ,
9
+ "kind" : "script" ,
10
+ "childItems" : [
11
+ {
12
+ "text" : "f" ,
13
+ "kind" : "function"
14
+ } ,
15
+ {
16
+ "text" : "x" ,
17
+ "kind" : "property"
18
+ }
19
+ ]
20
+ } ) ;
21
+
22
+ verify . navigationBar ( [
23
+ {
24
+ "text" : "<global>" ,
25
+ "kind" : "script" ,
26
+ "childItems" : [
27
+ {
28
+ "text" : "f" ,
29
+ "kind" : "function"
30
+ } ,
31
+ {
32
+ "text" : "x" ,
33
+ "kind" : "property"
34
+ }
35
+ ]
36
+ } ,
37
+ {
38
+ "text" : "f" ,
39
+ "kind" : "function" ,
40
+ "indent" : 1
41
+ }
42
+ ] ) ;
You can’t perform that action at this time.
0 commit comments