Support ${workspaceFolder} in buildifier & bazel paths
See original GitHub issueI can add a bazel path relative to the vscode workspace root, but I can’t do the same for a buildifier path.
Here’s the buildifier path code which is not relative to the workspace root: https://github.com/bazelbuild/vscode-bazel/blob/d2e0b7dd9f387ee66829e960b2016dba474b2df8/src/buildifier/buildifier_availability.ts#L33
Here’s the bazel path code which is relative to the workspace root: https://github.com/bazelbuild/vscode-bazel/blob/8fbcd2769228731827c4b7c2ba3bbc36bb1f5e34/src/bazel/tasks.ts#L72
These should obviously use the same code and both should support paths relative to the workspace root 😃
Note: most other vscode extensions support putting ${workspaceRoot}
in the path to refer to the vscode workspace root. For example, clangd, protoc, shellcheck, and python all do this, and I’m sure many more.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
It’s extremely common for extensions to support either relative paths from the workspace root or something like
$workspace_root
… so, do whatever they do? Perhaps just where the workspace file actually is?Is there a solution here that doesn’t require absolute paths for only the
buildifier
binary?In case it’s not clear, we have to have settings like:
We can write the
bazel.executable
setting once and share it amongst a team, but we cannot write thebazel.buildifierExecutable
setting once and share it amongst a team. The absolute path is almost never the same between different machines: platforms, users, personal preference, etc.Instead, it would be ideal if we could use the same relative path support for
buildifier
that we can currently use forbazel
: