Only implement "open file" when you click a file node (not a folder)

This commit is contained in:
shati-patel
2023-05-17 14:43:43 +01:00
parent ec1fda21d0
commit 565a7a53e0

View File

@@ -8,10 +8,12 @@ export class QueryTreeViewItem extends vscode.TreeItem {
this.collapsibleState = this.children.length
? vscode.TreeItemCollapsibleState.Collapsed
: vscode.TreeItemCollapsibleState.None;
this.command = {
title: "Open",
command: "vscode.open",
arguments: [vscode.Uri.file(path)],
};
if (this.children.length === 0) {
this.command = {
title: "Open",
command: "vscode.open",
arguments: [vscode.Uri.file(path)],
};
}
}
}