Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/java/hierarchicalPackageNodeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export class HierarchicalPackageNodeData implements INodeData {
private nodeData: INodeData = null;

public get uri() {
return this.nodeData.uri;
return this.nodeData && this.nodeData.uri;
}

public get moduleName() {
return this.nodeData.moduleName;
return this.nodeData && this.nodeData.moduleName;
}

public get path() {
return this.nodeData.path;
return this.nodeData && this.nodeData.path;
}

public get kind() {
Expand Down
5 changes: 5 additions & 0 deletions src/views/dataNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export abstract class DataNode extends ExplorerNode {
public getTreeItem(): TreeItem | Promise<TreeItem> {
if (this._nodeData) {
const item = new TreeItem(this._nodeData.name, this.hasChildren() ? TreeItemCollapsibleState.Collapsed : TreeItemCollapsibleState.None);
item.description = this.description;
item.iconPath = this.iconPath;
item.command = this.command;
item.contextValue = this.computeContextValue();
Expand Down Expand Up @@ -80,6 +81,10 @@ export abstract class DataNode extends ExplorerNode {
return true;
}

protected get description(): string | boolean {
return undefined;
}

protected get contextValue(): string {
return undefined;
}
Expand Down
4 changes: 1 addition & 3 deletions src/views/hierarchicalPackageNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export class HierarchicalPackageNode extends PackageNode {
if (this._nodeData) {
const item = new TreeItem(this.getHierarchicalNodeData().displayName,
this.hasChildren() ? TreeItemCollapsibleState.Collapsed : TreeItemCollapsibleState.None);
item.iconPath = this.iconPath;
item.command = this.command;
return item;
return { ...super.getTreeItem(), ...item };
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/views/packageRootNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ export class PackageRootNode extends DataNode {
return result;
}

protected get description(): string | boolean {
const data = <IPackageRootNodeData>this.nodeData;
if (data.entryKind === PackageRootKind.K_BINARY) {
return data.path;
} else {
return undefined;
}
}

protected get contextValue(): string {
const data = <IPackageRootNodeData>this.nodeData;
if (data.entryKind === PackageRootKind.K_BINARY) {
Expand Down