Skip to content

Commit

Permalink
Simplify the server status item click action (#3537)
Browse files Browse the repository at this point in the history
Signed-off-by: Sheng Chen <[email protected]>
  • Loading branch information
jdneo authored Mar 22, 2024
1 parent b9500ba commit 8e71cb2
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,21 +358,13 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
// Register commands here to make it available even when the language client fails
context.subscriptions.push(commands.registerCommand(Commands.OPEN_STATUS_SHORTCUT, async (status: string) => {
const items: ShortcutQuickPickItem[] = [];
let statusCommand: string;
if (status === ServerStatusKind.error || status === ServerStatusKind.warning) {
statusCommand = "workbench.panel.markers.view.focus";
commands.executeCommand("workbench.panel.markers.view.focus");
} else {
statusCommand = Commands.SHOW_SERVER_TASK_STATUS;
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS);
}

items.push({
label: `$(coffee) Status: ${status}`,
command: statusCommand,
}, {
label: "",
kind: QuickPickItemKind.Separator,
command: "",
}, {
label: CommandTitle.OPEN_JAVA_SETTINGS,
command: "workbench.action.openSettings",
args: ["java"],
Expand All @@ -384,7 +376,10 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
command: Commands.CLEAN_WORKSPACE
});

const choice = await window.showQuickPick(items);
const choice = await window.showQuickPick(items, {
ignoreFocusOut: true,
placeHolder: "Press 'ESC' to close."
});
if (!choice) {
return;
}
Expand Down

0 comments on commit 8e71cb2

Please sign in to comment.