From aad33a871a7024419e5b45ed269e34d101ad8d29 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Thu, 22 Feb 2024 15:16:38 +0100 Subject: [PATCH] fix: only "start" scan once, fix handleCodeLensRefresh and handleInlineValueRefresh --- src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt index 71e518485..c7c5b6ba9 100644 --- a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt +++ b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt @@ -76,13 +76,13 @@ class SnykLanguageClient : LanguageClient { override fun refreshCodeLenses(): CompletableFuture { val activeProject = ProjectUtil.getActiveProject() ?: return CompletableFuture.completedFuture(null) - DaemonCodeAnalyzer.getInstance(activeProject) + DaemonCodeAnalyzer.getInstance(activeProject).restart() return CompletableFuture.completedFuture(null) } override fun refreshInlineValues(): CompletableFuture { val activeProject = ProjectUtil.getActiveProject() ?: return CompletableFuture.completedFuture(null) - DaemonCodeAnalyzer.getInstance(activeProject) + DaemonCodeAnalyzer.getInstance(activeProject).restart() return CompletableFuture.completedFuture(null) } @@ -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) }