File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ export class HierarchicalPackageNodeData implements INodeData {
18
18
private nodeData : INodeData = null ;
19
19
20
20
public get uri ( ) {
21
- return this . nodeData . uri ;
21
+ return this . nodeData && this . nodeData . uri ;
22
22
}
23
23
24
24
public get moduleName ( ) {
25
- return this . nodeData . moduleName ;
25
+ return this . nodeData && this . nodeData . moduleName ;
26
26
}
27
27
28
28
public get path ( ) {
29
- return this . nodeData . path ;
29
+ return this . nodeData && this . nodeData . path ;
30
30
}
31
31
32
32
public get kind ( ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export abstract class DataNode extends ExplorerNode {
14
14
public getTreeItem ( ) : TreeItem | Promise < TreeItem > {
15
15
if ( this . _nodeData ) {
16
16
const item = new TreeItem ( this . _nodeData . name , this . hasChildren ( ) ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ;
17
+ item . description = this . description ;
17
18
item . iconPath = this . iconPath ;
18
19
item . command = this . command ;
19
20
item . contextValue = this . computeContextValue ( ) ;
@@ -80,6 +81,10 @@ export abstract class DataNode extends ExplorerNode {
80
81
return true ;
81
82
}
82
83
84
+ protected get description ( ) : string | boolean {
85
+ return undefined ;
86
+ }
87
+
83
88
protected get contextValue ( ) : string {
84
89
return undefined ;
85
90
}
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ export class HierarchicalPackageNode extends PackageNode {
21
21
if ( this . _nodeData ) {
22
22
const item = new TreeItem ( this . getHierarchicalNodeData ( ) . displayName ,
23
23
this . hasChildren ( ) ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ;
24
- item . iconPath = this . iconPath ;
25
- item . command = this . command ;
26
- return item ;
24
+ return { ...super . getTreeItem ( ) , ...item } ;
27
25
}
28
26
}
29
27
Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ export class PackageRootNode extends DataNode {
42
42
return result ;
43
43
}
44
44
45
+ protected get description ( ) : string | boolean {
46
+ const data = < IPackageRootNodeData > this . nodeData ;
47
+ if ( data . entryKind === PackageRootKind . K_BINARY ) {
48
+ return data . path ;
49
+ } else {
50
+ return undefined ;
51
+ }
52
+ }
53
+
45
54
protected get contextValue ( ) : string {
46
55
const data = < IPackageRootNodeData > this . nodeData ;
47
56
if ( data . entryKind === PackageRootKind . K_BINARY ) {
You can’t perform that action at this time.
0 commit comments