Skip to content

Commit

Permalink
Add bazel.info.workspace command variable
Browse files Browse the repository at this point in the history
Not sure why this wasn't added initially in bazel-contrib#291. Maybe the assumption
was that the workspace root is already available through VS Code's
`${workspaceFolder}`. However, that represents the place where VS Code
was opened. The Bazel workspace folder might be further up in the
directory tree.
  • Loading branch information
vogelsgesang committed Feb 29, 2024
1 parent 2180a4c commit 1b53b22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"onCommand:bazel.info.bazel-testlogs",
"onCommand:bazel.info.execution_root",
"onCommand:bazel.info.output_base",
"onCommand:bazel.info.output_path"
"onCommand:bazel.info.output_path",
"onCommand:bazel.info.workspace"
],
"main": "./out/src/extension/extension",
"contributes": {
Expand Down
1 change: 1 addition & 0 deletions src/extension/command_variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export function activateCommandVariables(): vscode.Disposable[] {
"execution_root",
"output_base",
"output_path",
"workspace",
].map((key) =>
vscode.commands.registerCommand(`bazel.info.${key}`, () =>
bazelInfo(key),
Expand Down

0 comments on commit 1b53b22

Please sign in to comment.