Skip to content

Commit 57d842f

Browse files
committed
move localize map to devcommand
1 parent 1afcdc5 commit 57d842f

2 files changed

Lines changed: 21 additions & 20 deletions

File tree

src/definitions/constants.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* IBM Confidential
33
* Copyright IBM Corp. 2020, 2026
44
*/
5-
import { localize } from "../util/i18nUtil";
65

76
// ---------------------------------------------------------------------------
87
// Project Context Values
@@ -71,21 +70,6 @@ export const CMD_OPEN_GRADLE_TEST_REPORT = "liberty.dev.open.gradle.test.report"
7170
export const CMD_ADD_PROJECT = "liberty.dev.add.project";
7271
export const CMD_REMOVE_PROJECT = "liberty.dev.remove.project";
7372

74-
export const COMMAND_TITLES = new Map();
75-
COMMAND_TITLES.set(localize("hotkey.commands.title.refresh"), CMD_EXPLORER_REFRESH);
76-
COMMAND_TITLES.set(localize("hotkey.commands.title.start"), CMD_START);
77-
COMMAND_TITLES.set(localize("hotkey.commands.title.start.custom"), CMD_CUSTOM);
78-
COMMAND_TITLES.set(localize("hotkey.commands.title.start.in.container"), CMD_START_CONTAINER);
79-
COMMAND_TITLES.set(localize("hotkey.commands.title.debug"), CMD_DEBUG);
80-
COMMAND_TITLES.set(localize("hotkey.commands.title.stop"), CMD_STOP);
81-
COMMAND_TITLES.set(localize("hotkey.commands.title.run.tests"), CMD_RUN_TESTS);
82-
COMMAND_TITLES.set(localize("hotkey.commands.title.view.integration.test.report"), CMD_OPEN_FAILSAFE_REPORT);
83-
COMMAND_TITLES.set(localize("hotkey.commands.title.view.unit.test.report"), CMD_OPEN_SUREFIRE_REPORT);
84-
COMMAND_TITLES.set(localize("hotkey.commands.title.view.test.report"), CMD_OPEN_GRADLE_TEST_REPORT);
85-
COMMAND_TITLES.set(localize("hotkey.commands.title.add.project"), CMD_ADD_PROJECT);
86-
COMMAND_TITLES.set(localize("hotkey.commands.title.remove.project"), CMD_REMOVE_PROJECT);
87-
COMMAND_TITLES.set(localize("hotkey.commands.title.open.build.file"), CMD_OPEN_BUILD_FILE);
88-
8973
// ---------------------------------------------------------------------------
9074
// Project Discovery
9175
// ---------------------------------------------------------------------------

src/liberty/devCommands.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import { ProjectRegistry } from "./projectRegistry";
1414
import { ProjectTreeProvider } from "./projectTreeProvider";
1515
import { getReport } from "../util/helperUtil";
1616
import {
17-
COMMAND_TITLES, LIBERTY_SERVER_ENV_PORT_REGEX, isMaven, isGradle,
17+
LIBERTY_SERVER_ENV_PORT_REGEX, isMaven, isGradle,
1818
MAVEN_GOAL_DEV, MAVEN_GOAL_DEVC, GRADLE_TASK_DEV, GRADLE_TASK_DEVC,
19-
CMD_OPEN_BUILD_FILE, CMD_START, CMD_STOP, CMD_DEBUG, CMD_CUSTOM,
20-
CMD_START_CONTAINER, CMD_RUN_TESTS,
19+
CMD_EXPLORER_REFRESH, CMD_OPEN_BUILD_FILE, CMD_START, CMD_STOP, CMD_DEBUG, CMD_CUSTOM,
20+
CMD_START_CONTAINER, CMD_RUN_TESTS, CMD_OPEN_FAILSAFE_REPORT, CMD_OPEN_SUREFIRE_REPORT,
21+
CMD_OPEN_GRADLE_TEST_REPORT, CMD_ADD_PROJECT, CMD_REMOVE_PROJECT,
2122
} from "../definitions/constants";
2223
import { getGradleTestReport } from "../util/gradleUtil";
2324
import { DashboardData } from "./dashboard";
@@ -66,7 +67,23 @@ export async function openBuildFile(libProject?: LibertyProject): Promise<void>
6667
vscode.commands.executeCommand("vscode.open", vscode.Uri.file(targetProject.getPath()));
6768
}
6869

69-
// List all liberty dev commands, triggerred by hotkey only (Shift+Cmd+L)
70+
// List all liberty dev commands, triggered by hotkey (Shift+Alt+L)
71+
const COMMAND_TITLES = new Map<string, string>([
72+
[localize("hotkey.commands.title.refresh"), CMD_EXPLORER_REFRESH],
73+
[localize("hotkey.commands.title.start"), CMD_START],
74+
[localize("hotkey.commands.title.start.custom"), CMD_CUSTOM],
75+
[localize("hotkey.commands.title.start.in.container"), CMD_START_CONTAINER],
76+
[localize("hotkey.commands.title.debug"), CMD_DEBUG],
77+
[localize("hotkey.commands.title.stop"), CMD_STOP],
78+
[localize("hotkey.commands.title.run.tests"), CMD_RUN_TESTS],
79+
[localize("hotkey.commands.title.view.integration.test.report"), CMD_OPEN_FAILSAFE_REPORT],
80+
[localize("hotkey.commands.title.view.unit.test.report"), CMD_OPEN_SUREFIRE_REPORT],
81+
[localize("hotkey.commands.title.view.test.report"), CMD_OPEN_GRADLE_TEST_REPORT],
82+
[localize("hotkey.commands.title.add.project"), CMD_ADD_PROJECT],
83+
[localize("hotkey.commands.title.remove.project"), CMD_REMOVE_PROJECT],
84+
[localize("hotkey.commands.title.open.build.file"), CMD_OPEN_BUILD_FILE],
85+
]);
86+
7087
export async function listAllCommands(): Promise<void> {
7188
const libertyCommands = Array.from(COMMAND_TITLES.keys());
7289
vscode.window.showQuickPick(libertyCommands).then(selection => {

0 commit comments

Comments
 (0)