Skip to content

Commit

Permalink
feat(codelens) Add a "copy target" command (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
romannikov authored Jul 3, 2024
1 parent 00d9971 commit da62c67
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/codelens/bazel_build_code_lens_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ export class BazelBuildCodeLensProvider implements vscode.CodeLensProvider {

const commands: LensCommand[] = [];

// All targets support target copying and building.
commands.push({
commandString: "bazel.copyTargetToClipboard",
name: "Copy",
});
commands.push({
commandString: "bazel.buildTarget",
name: "Build",
});

// Only test targets support testing.
if (ruleClass.endsWith("_test") || ruleClass === "test_suite") {
commands.push({
Expand All @@ -161,12 +171,6 @@ export class BazelBuildCodeLensProvider implements vscode.CodeLensProvider {
});
}

// All targets support building.
commands.push({
commandString: "bazel.buildTarget",
name: "Build",
});

for (const command of commands) {
const title = `${command.name} ${targetShortName}`;
result.push(
Expand Down

0 comments on commit da62c67

Please sign in to comment.