vscode-bazel icon indicating copy to clipboard operation
vscode-bazel copied to clipboard

Add `bazel.info.*` commands

Open jfirebaugh opened this issue 3 years ago • 0 comments

I propose adding a set of commands to the plugin: bazel.info.bazel-bin, bazel.info.bazel-genfiles, and so on, for all or some subset of the bazel info keys. Each command would do nothing but output the value of the corresponding key.

Here's why this would be useful: command variables. Using these commands, one could define launch configurations in a way that does not hard-code architecture-specific or workspace-specific details. For example instead of writing

  "program": "${workspaceFolder}/bazel-out/darwin-dbg/bin/example",

as in this widely-cited post, you could write:

  "program": "${command:bazel.info.bazel-bin}/example",

The latter will work on Apple Silicon and workspaces that use --experimental_convenience_symlinks=clean.

If there's support for this feature, I can supply a PR.

jfirebaugh avatar Aug 18 '22 04:08 jfirebaugh