Skip to content

Commit 8e71cb2

Browse files
authored
Simplify the server status item click action (#3537)
Signed-off-by: Sheng Chen <sheche@microsoft.com>
1 parent b9500ba commit 8e71cb2

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

src/extension.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,21 +358,13 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
358358
// Register commands here to make it available even when the language client fails
359359
context.subscriptions.push(commands.registerCommand(Commands.OPEN_STATUS_SHORTCUT, async (status: string) => {
360360
const items: ShortcutQuickPickItem[] = [];
361-
let statusCommand: string;
362361
if (status === ServerStatusKind.error || status === ServerStatusKind.warning) {
363-
statusCommand = "workbench.panel.markers.view.focus";
362+
commands.executeCommand("workbench.panel.markers.view.focus");
364363
} else {
365-
statusCommand = Commands.SHOW_SERVER_TASK_STATUS;
364+
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS);
366365
}
367366

368367
items.push({
369-
label: `$(coffee) Status: ${status}`,
370-
command: statusCommand,
371-
}, {
372-
label: "",
373-
kind: QuickPickItemKind.Separator,
374-
command: "",
375-
}, {
376368
label: CommandTitle.OPEN_JAVA_SETTINGS,
377369
command: "workbench.action.openSettings",
378370
args: ["java"],
@@ -384,7 +376,10 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
384376
command: Commands.CLEAN_WORKSPACE
385377
});
386378

387-
const choice = await window.showQuickPick(items);
379+
const choice = await window.showQuickPick(items, {
380+
ignoreFocusOut: true,
381+
placeHolder: "Press 'ESC' to close."
382+
});
388383
if (!choice) {
389384
return;
390385
}

0 commit comments

Comments
 (0)