Skip to content

Commit

Permalink
Don't build a target by clicking its node, expand the node instead.
Browse files Browse the repository at this point in the history
Added an inline build button on a target node.
  • Loading branch information
lukester1975 committed Nov 23, 2023
1 parent 34545bd commit d440673
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,19 +443,24 @@
"group": "build@2"
},
{
"command": "mesonbuild.openBuildFile",
"command": "mesonbuild.node.build",
"when": "view == meson-project && viewItem == meson-target",
"group": "inline"
"group": "inline@0"
},
{
"command": "mesonbuild.openBuildFile",
"when": "view == meson-project && viewItem == meson-target",
"group": "build"
"group": "inline@1"
},
{
"command": "mesonbuild.node.build",
"when": "view == meson-project && viewItem == meson-target",
"group": "build"
"group": "build@0"
},
{
"command": "mesonbuild.openBuildFile",
"when": "view == meson-project && viewItem == meson-target",
"group": "build@1"
},
{
"command": "mesonbuild.node.runAll",
Expand Down
10 changes: 1 addition & 9 deletions src/treeview/nodes/targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class TargetNode extends BaseNode implements IBuildableNode {
}
}

override async getTreeItem() {
override getTreeItem() {
const item = super.getTreeItem() as vscode.TreeItem;

item.label = this.target.name;
Expand All @@ -112,14 +112,6 @@ export class TargetNode extends BaseNode implements IBuildableNode {
item.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
item.contextValue = "meson-target";

const targetName = await getTargetName(this.target);

item.command = {
title: `Build ${this.target.name}`,
command: "mesonbuild.build",
arguments: [targetName],
};

return item;
}

Expand Down

0 comments on commit d440673

Please sign in to comment.