Skip to content

Commit

Permalink
fix: only "start" scan once, fix handleCodeLensRefresh and handleInli…
Browse files Browse the repository at this point in the history
…neValueRefresh
  • Loading branch information
bastiandoetsch committed Feb 22, 2024
1 parent 7de0dd6 commit aad33a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class SnykLanguageClient : LanguageClient {

override fun refreshCodeLenses(): CompletableFuture<Void> {
val activeProject = ProjectUtil.getActiveProject() ?: return CompletableFuture.completedFuture(null)
DaemonCodeAnalyzer.getInstance(activeProject)
DaemonCodeAnalyzer.getInstance(activeProject).restart()
return CompletableFuture.completedFuture(null)
}

override fun refreshInlineValues(): CompletableFuture<Void> {
val activeProject = ProjectUtil.getActiveProject() ?: return CompletableFuture.completedFuture(null)
DaemonCodeAnalyzer.getInstance(activeProject)
DaemonCodeAnalyzer.getInstance(activeProject).restart()
return CompletableFuture.completedFuture(null)
}

Expand All @@ -92,6 +92,7 @@ class SnykLanguageClient : LanguageClient {
getScanPublishersFor(snykScan).forEach { (project, scanPublisher) ->
when (snykScan.status) {
"inProgress" -> {
if (ScanState.scanInProgress[snykScan.product] == true) return
ScanState.scanInProgress[snykScan.product] = true
scanPublisher.scanningStarted(snykScan)
}
Expand Down

0 comments on commit aad33a8

Please sign in to comment.