Skip to content

Commit

Permalink
Fix the focus issue of the java shortcuts
Browse files Browse the repository at this point in the history
Signed-off-by: Sheng Chen <[email protected]>
  • Loading branch information
jdneo authored and rgrunber committed Mar 28, 2024
1 parent 0ad5940 commit d588794
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
if (status === ServerStatusKind.error || status === ServerStatusKind.warning) {
commands.executeCommand("workbench.panel.markers.view.focus");
} else {
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS);
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS, true);
}

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

const choice = await window.showQuickPick(items, {
ignoreFocusOut: true,
placeHolder: "Press 'ESC' to close."
});
const choice = await window.showQuickPick(items);
if (!choice) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/serverTaskPresenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { getJavaConfiguration } from "./utils";
const JAVA_SERVER_TASK_PRESENTER_TASK_NAME = "Java Build Status";

export namespace serverTaskPresenter {
export async function presentServerTaskView() {
export async function presentServerTaskView(preserveFocus?: boolean) {
const execution = await getPresenterTaskExecution();
const terminals = window.terminals;
const presenterTerminals = terminals.filter(terminal => terminal.name.indexOf(execution.task.name) >= 0);
if (presenterTerminals.length > 0) {
presenterTerminals[0].show();
presenterTerminals[0].show(preserveFocus);
}
activationProgressNotification.hide();
}
Expand Down
2 changes: 1 addition & 1 deletion src/standardLanguageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export class StandardLanguageClient {
}));

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

public start(): Promise<void> {
Expand Down

0 comments on commit d588794

Please sign in to comment.