From 1b53b2214efa9b3ab84103d5b99c5d9c2b70e411 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Thu, 29 Feb 2024 05:50:48 +0100 Subject: [PATCH] Add `bazel.info.workspace` command variable Not sure why this wasn't added initially in #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. --- package.json | 3 ++- src/extension/command_variables.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1affd135..f4a5bfb9 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/extension/command_variables.ts b/src/extension/command_variables.ts index bc729d2c..bc9b8d04 100644 --- a/src/extension/command_variables.ts +++ b/src/extension/command_variables.ts @@ -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),