Skip to content

Commit

Permalink
Prevent stealing of focus for the test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
petrovic-d committed Dec 16, 2024
1 parent d7259e6 commit d311c45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion java/java.lsp.server/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,10 @@ class LineBufferingPseudoterminal implements vscode.Pseudoterminal {
pty: this,
});
}
this.terminal.show(true);
// Prevent 'stealing' of the focus when running tests in parallel
if (!testAdapter?.testInParallelProfileExist()) {
this.terminal.show(true);
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions java/java.lsp.server/vscode/src/testAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class NbTestAdapter {
this.load();
}

public testInParallelProfileExist(): boolean {
return this.parallelRunProfile ? true : false;
}

public runTestsWithParallelParallel(projects?: string[]) {
if (this.parallelRunProfile) {
this.run(new TestRunRequest(undefined, undefined, this.parallelRunProfile), new CancellationTokenSource().token, true, projects);
Expand Down

0 comments on commit d311c45

Please sign in to comment.