Skip to content

Commit 30bf975

Browse files
fix: Use "go to" instead of "jump" (#468)
This changes the terminology used in various commands from "go to" to "jump". This terminology is already used all over vscode, whereas jump is not. This was agreed in #463.
1 parent bc2abea commit 30bf975

File tree

7 files changed

+25
-28
lines changed

7 files changed

+25
-28
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ This extension provides support for Bazel in Visual Studio.
1616
- **Bazel Task** definitions for `tasks.json`
1717
- **Coverage Support** showing coverage results from `bazel coverage` directly
1818
in VS Code.
19-
- **Code Navigation** to jump to BUILD files or labels
19+
- **Code Navigation** to go to BUILD files or labels
2020
- Debug Starlark code in your `.bzl` files during a build (set breakpoints, step
2121
through code, inspect variables, etc.)
22-
- URI handler to jump to targets from outside of VSCode. (Example: vscode://bazelbuild.vscode-bazel//path/to/tests:target)
22+
- URI handler to go to targets from outside of VSCode. (Example: vscode://bazelbuild.vscode-bazel//path/to/tests:target)
2323

2424
## Configuring the Extension
2525

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
},
8989
{
9090
"category": "Bazel",
91-
"command": "bazel.jumpToBuildFile",
92-
"title": "Jump to BUILD file"
91+
"command": "bazel.goToBuildFile",
92+
"title": "Go to BUILD file"
9393
},
9494
{
9595
"category": "Bazel",
96-
"command": "bazel.jumpToLabel",
97-
"title": "Jump to Bazel Label"
96+
"command": "bazel.goToLabel",
97+
"title": "Go to Label"
9898
},
9999
{
100100
"category": "Bazel",
@@ -362,11 +362,11 @@
362362
"when": "bazel.haveWorkspace"
363363
},
364364
{
365-
"command": "bazel.jumpToBuildFile",
365+
"command": "bazel.goToBuildFile",
366366
"when": "bazel.haveWorkspace"
367367
},
368368
{
369-
"command": "bazel.jumpToLabel",
369+
"command": "bazel.goToLabel",
370370
"when": "bazel.haveWorkspace"
371371
}
372372
],

src/extension/bazel_wrapper_commands.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,18 @@ async function bazelClean() {
301301
}
302302

303303
/**
304-
* Jumps to the BUILD file for the current package.
304+
* Navigates to the BUILD file for the current package.
305305
*
306306
* This command finds the nearest BUILD or BUILD.bazel file in the current file's
307307
* directory or any parent directory and opens it in the editor. The search is
308308
* limited to the current Bazel workspace.
309309
*/
310-
async function bazelJumpToBuildFile() {
310+
async function bazelGoToBuildFile() {
311311
const currentEditor = vscode.window.activeTextEditor;
312312
if (!currentEditor) {
313313
// eslint-disable-next-line @typescript-eslint/no-floating-promises
314314
vscode.window.showInformationMessage(
315-
"Please open a file to jump to its BUILD file.",
315+
"Please open a file to go to its BUILD file.",
316316
);
317317
return;
318318
}
@@ -333,13 +333,13 @@ async function bazelJumpToBuildFile() {
333333
}
334334

335335
/**
336-
* Jumps to the BUILD file location for the specified label.
336+
* Navigates to the BUILD file location for the specified label.
337337
*
338338
* This command finds the BUILD file location for the specified label and opens
339339
* it in the editor.
340-
* @param target_info Optional target information to jump to directly, bypassing the quick pick
340+
* @param target_info Optional target information to go to directly, bypassing the quick pick
341341
*/
342-
async function bazelJumpToLabel(target_info?: blaze_query.ITarget | undefined) {
342+
async function bazelGoToLabel(target_info?: blaze_query.ITarget | undefined) {
343343
if (!target_info) {
344344
const quickPick = await vscode.window.showQuickPick(
345345
queryQuickPickTargets({ query: "kind('.* rule', ...)" }),
@@ -392,10 +392,7 @@ export function activateWrapperCommands(): vscode.Disposable[] {
392392
bazelTestAllRecursive,
393393
),
394394
vscode.commands.registerCommand("bazel.clean", bazelClean),
395-
vscode.commands.registerCommand(
396-
"bazel.jumpToBuildFile",
397-
bazelJumpToBuildFile,
398-
),
399-
vscode.commands.registerCommand("bazel.jumpToLabel", bazelJumpToLabel),
395+
vscode.commands.registerCommand("bazel.goToBuildFile", bazelGoToBuildFile),
396+
vscode.commands.registerCommand("bazel.goToLabel", bazelGoToLabel),
400397
];
401398
}

src/workspace-tree/bazel_target_tree_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class BazelTargetTreeItem
7272
{ selection: location.range },
7373
],
7474
command: "vscode.open",
75-
title: "Jump to Build Target",
75+
title: "Go to Build Target",
7676
};
7777
}
7878

test/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# This BUILD file is used for testing the jump to build file feature
2-
# It is located one level above the bazel_workspace and should not be found as it's outside the bazel workspace
1+
# This BUILD file is used for testing the go to build file feature
2+
# It is located one level above the bazel_workspace and should not be found as it's outside the bazel workspace

test/jump_to_build_file.test.ts renamed to test/go_to_build_file.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface TestCase {
2323
expectedBuildFile: string | null; // null means no BUILD file should be found
2424
}
2525

26-
describe("Jump to Build File", () => {
26+
describe("Go to Build File", () => {
2727
const workspacePath = path.join(
2828
__dirname,
2929
"..",
@@ -82,7 +82,7 @@ describe("Jump to Build File", () => {
8282
assertEditorIsActive(sourceFile);
8383

8484
// WHEN
85-
await vscode.commands.executeCommand("bazel.jumpToBuildFile");
85+
await vscode.commands.executeCommand("bazel.goToBuildFile");
8686

8787
// THEN
8888
const expectedFile = expectedBuildFile || sourceFile;
@@ -100,7 +100,7 @@ describe("Jump to Build File", () => {
100100
errorShown = true;
101101
});
102102

103-
await vscode.commands.executeCommand("bazel.jumpToBuildFile");
103+
await vscode.commands.executeCommand("bazel.goToBuildFile");
104104

105105
// THEN
106106
assert.strictEqual(

test/jump_to_label.test.ts renamed to test/go_to_label.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function assertEditorIsActive(
3737
);
3838
}
3939

40-
describe("Jump to Label", () => {
40+
describe("Go to Label", () => {
4141
const workspacePath = path.join(
4242
__dirname,
4343
"..",
@@ -50,7 +50,7 @@ describe("Jump to Label", () => {
5050
await vscode.commands.executeCommand("workbench.action.closeAllEditors");
5151
});
5252

53-
it("should jump to correct line in BUILD file", async () => {
53+
it("should go to correct line in BUILD file", async () => {
5454
// GIVEN
5555
const targetLabel = "//pkg1:main";
5656
const expectedFile = path.join(workspacePath, "pkg1", "BUILD");
@@ -64,7 +64,7 @@ describe("Jump to Label", () => {
6464
});
6565

6666
// WHEN
67-
await vscode.commands.executeCommand("bazel.jumpToLabel", mockTargetInfo);
67+
await vscode.commands.executeCommand("bazel.goToLabel", mockTargetInfo);
6868

6969
// THEN
7070
assertEditorIsActive(expectedFile, expectedLine, expectedCharacter);

0 commit comments

Comments
 (0)