Skip to content

Commit d588794

Browse files
jdneorgrunber
authored andcommitted
Fix the focus issue of the java shortcuts
Signed-off-by: Sheng Chen <sheche@microsoft.com>
1 parent 0ad5940 commit d588794

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/extension.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
361361
if (status === ServerStatusKind.error || status === ServerStatusKind.warning) {
362362
commands.executeCommand("workbench.panel.markers.view.focus");
363363
} else {
364-
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS);
364+
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS, true);
365365
}
366366

367367
items.push({
@@ -376,10 +376,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
376376
command: Commands.CLEAN_WORKSPACE
377377
});
378378

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

src/serverTaskPresenter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { getJavaConfiguration } from "./utils";
88
const JAVA_SERVER_TASK_PRESENTER_TASK_NAME = "Java Build Status";
99

1010
export namespace serverTaskPresenter {
11-
export async function presentServerTaskView() {
11+
export async function presentServerTaskView(preserveFocus?: boolean) {
1212
const execution = await getPresenterTaskExecution();
1313
const terminals = window.terminals;
1414
const presenterTerminals = terminals.filter(terminal => terminal.name.indexOf(execution.task.name) >= 0);
1515
if (presenterTerminals.length > 0) {
16-
presenterTerminals[0].show();
16+
presenterTerminals[0].show(preserveFocus);
1717
}
1818
activationProgressNotification.hide();
1919
}

src/standardLanguageClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ export class StandardLanguageClient {
698698
}));
699699

700700
context.subscriptions.push(commands.registerCommand(Commands.OPEN_OUTPUT, () => this.languageClient.outputChannel.show(ViewColumn.Three)));
701-
context.subscriptions.push(commands.registerCommand(Commands.SHOW_SERVER_TASK_STATUS, () => serverTaskPresenter.presentServerTaskView()));
701+
context.subscriptions.push(commands.registerCommand(Commands.SHOW_SERVER_TASK_STATUS, (preserveFocus?: boolean) => serverTaskPresenter.presentServerTaskView(preserveFocus)));
702702
}
703703

704704
public start(): Promise<void> {

0 commit comments

Comments
 (0)