Skip to content

Commit 8b74aa2

Browse files
Add "Run" command to binary targets in Codelens (#302)
Addresses #251 Co-authored-by: John Firebaugh <jfirebaugh@figma.com>
1 parent be40d71 commit 8b74aa2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/codelens/bazel_build_code_lens_provider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ export class BazelBuildCodeLensProvider implements vscode.CodeLensProvider {
122122
title: `Test ${targetName}`,
123123
tooltip: `Test ${targetName}`,
124124
};
125+
} else if (ruleClass.endsWith("_binary")) {
126+
cmd = {
127+
arguments: [
128+
new CodeLensCommandAdapter(bazelWorkspaceInfo, [targetName]),
129+
],
130+
command: "bazel.runTarget",
131+
title: `Run ${targetName}`,
132+
tooltip: `Run ${targetName}`,
133+
};
125134
} else {
126135
cmd = {
127136
arguments: [

0 commit comments

Comments
 (0)