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 {
1818 private nodeData : INodeData = null ;
1919
2020 public get uri ( ) {
21- return this . nodeData . uri ;
21+ return this . nodeData && this . nodeData . uri ;
2222 }
2323
2424 public get moduleName ( ) {
25- return this . nodeData . moduleName ;
25+ return this . nodeData && this . nodeData . moduleName ;
2626 }
2727
2828 public get path ( ) {
29- return this . nodeData . path ;
29+ return this . nodeData && this . nodeData . path ;
3030 }
3131
3232 public get kind ( ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export abstract class DataNode extends ExplorerNode {
1414 public getTreeItem ( ) : TreeItem | Promise < TreeItem > {
1515 if ( this . _nodeData ) {
1616 const item = new TreeItem ( this . _nodeData . name , this . hasChildren ( ) ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ;
17+ item . description = this . description ;
1718 item . iconPath = this . iconPath ;
1819 item . command = this . command ;
1920 item . contextValue = this . computeContextValue ( ) ;
@@ -80,6 +81,10 @@ export abstract class DataNode extends ExplorerNode {
8081 return true ;
8182 }
8283
84+ protected get description ( ) : string | boolean {
85+ return undefined ;
86+ }
87+
8388 protected get contextValue ( ) : string {
8489 return undefined ;
8590 }
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ export class HierarchicalPackageNode extends PackageNode {
2121 if ( this . _nodeData ) {
2222 const item = new TreeItem ( this . getHierarchicalNodeData ( ) . displayName ,
2323 this . hasChildren ( ) ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ;
24- item . iconPath = this . iconPath ;
25- item . command = this . command ;
26- return item ;
24+ return { ...super . getTreeItem ( ) , ...item } ;
2725 }
2826 }
2927
Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ export class PackageRootNode extends DataNode {
4242 return result ;
4343 }
4444
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+
4554 protected get contextValue ( ) : string {
4655 const data = < IPackageRootNodeData > this . nodeData ;
4756 if ( data . entryKind === PackageRootKind . K_BINARY ) {
You can’t perform that action at this time.
0 commit comments