Skip to content

Commit 348544b

Browse files
authored
fix: show Snyk view without activating to prevent focus steal [IDE-1261] (#364)
Use IWorkbenchPage.VIEW_VISIBLE when opening the Snyk tool view so the view is shown but does not steal focus from the active editor tab. Fixes customer reports that the Snyk tab repeatedly took over the viewing area during scans, especially with many projects. Made-with: Cursor
1 parent ce8e06c commit 348544b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/src/main/java/io/snyk/languageserver/protocolextension/SnykExtendedLanguageClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ public void folderConfig(FolderConfigsParam folderConfigParam) {
424424
public void updateSummaryPanel(SummaryPanelParams summary) {
425425
CompletableFuture.runAsync(() -> {
426426
openToolView();
427-
this.toolView.updateSummary(summary.getSummary());
427+
if (this.toolView != null) {
428+
this.toolView.updateSummary(summary.getSummary());
429+
}
428430
});
429431
}
430432

@@ -482,7 +484,7 @@ private ISnykToolView openToolView() {
482484
Display.getDefault().syncExec(() -> {
483485
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
484486
try {
485-
toolView = (ISnykToolView) activePage.showView(SnykToolView.ID);
487+
toolView = (ISnykToolView) activePage.showView(SnykToolView.ID, null, IWorkbenchPage.VIEW_VISIBLE);
486488
} catch (PartInitException e) {
487489
SnykLogger.logError(e);
488490
return;

0 commit comments

Comments
 (0)