Skip to content

Commit

Permalink
SLLS-295 republish all taints on CaYC toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
sophio-japharidze-sonarsource committed Jan 10, 2025
1 parent c4ca2fb commit 2b91c28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void onChange(@Nullable WorkspaceSettings oldValue, WorkspaceSettings new
if (oldValue != null && oldValue.isFocusOnNewCode() != newValue.isFocusOnNewCode()) {
backendServiceFacade.getBackendService().toggleCleanAsYouCode();
openFilesCache.getAll().forEach(f -> diagnosticPublisher.publishDiagnostics(f.getUri(), false));
diagnosticPublisher.publishTaints();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public void publishTaints(URI f) {
client.publishTaintVulnerabilities(createPublishTaintsParams(f));
}

public void publishTaints() {
taintVulnerabilitiesCache.getTaintVulnerabilitiesPerFile().forEach((uri, taints) -> client.publishTaintVulnerabilities(createPublishTaintsParams(uri)));
}

public void publishHotspots(URI f) {
client.publishSecurityHotspots(createPublishSecurityHotspotsParams(f));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ void shouldNotifyBackendAndRepublishDiagnosticsOnToggle() {
verify(backendService).toggleCleanAsYouCode();
verify(diagnosticPublisher).publishDiagnostics(dummyFile1, false);
verify(diagnosticPublisher).publishDiagnostics(dummyFile2, false);
verify(diagnosticPublisher).publishTaints();
}
}

0 comments on commit 2b91c28

Please sign in to comment.