From 7e295e5d87e1db3f18cef6f4d97aa37b44e01299 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Tue, 11 Jun 2024 18:41:21 +0200 Subject: [PATCH] fix: dont use kotlin specific convenience function (#544) * fix: dont use kotlin specific convenience function * docs: update CHANGELOG.md --- CHANGELOG.md | 4 ++++ src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa75a0253..e48f8ba09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Snyk Security Changelog +## [2.8.4] +### Fixed +- dont use kotlin specific convenience function that may cause errors on non kotlin IDEs + ## [2.8.3] ### Added diff --git a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt index 5d0947aea..cecd27d42 100644 --- a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt +++ b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt @@ -6,6 +6,7 @@ import com.github.benmanes.caffeine.cache.RemovalListener import com.intellij.ide.impl.ProjectUtil import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ReadAction import com.intellij.openapi.command.WriteCommandAction import com.intellij.openapi.components.service @@ -47,7 +48,6 @@ import org.eclipse.lsp4j.WorkDoneProgressReport import org.eclipse.lsp4j.jsonrpc.services.JsonNotification import org.eclipse.lsp4j.services.LanguageClient import org.jetbrains.concurrency.runAsync -import org.jetbrains.kotlin.idea.util.application.executeOnPooledThread import snyk.common.ProductType import snyk.common.SnykFileIssueComparator import snyk.trust.WorkspaceTrustService @@ -374,7 +374,7 @@ class SnykLanguageClient() : LanguageClient { MessageType.Warning -> SnykBalloonNotificationHelper.showWarn(messageParams.message, project) MessageType.Info -> { val notification = SnykBalloonNotificationHelper.showInfo(messageParams.message, project) - executeOnPooledThread { + ApplicationManager.getApplication().executeOnPooledThread { Thread.sleep(5000) notification.expire() }