From 912ba61a7888e42d117f3273dff587031201f735 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Wed, 13 Mar 2024 08:55:53 +0100 Subject: [PATCH] fix: remove duplicated annotator definition [IDE-192] Apparently "" is sufficient for any language. --- CHANGELOG.md | 2 ++ src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt | 1 - src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt | 6 ++++++ src/main/resources/META-INF/optional/withCsharp.xml | 2 -- src/main/resources/META-INF/optional/withGo.xml | 4 ---- src/main/resources/META-INF/optional/withHTML.xml | 2 -- src/main/resources/META-INF/optional/withJava.xml | 4 ---- src/main/resources/META-INF/optional/withJavaScript.xml | 2 -- src/main/resources/META-INF/optional/withKotlin.xml | 2 -- src/main/resources/META-INF/optional/withPHP.xml | 2 -- src/main/resources/META-INF/optional/withPython.xml | 2 -- src/main/resources/META-INF/plugin.xml | 2 +- 12 files changed, 9 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 660ecb359..4b7ba72e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [2.7.9] ### Fixed - fix: shortened plugin name to just Snyk Security +- (LS Preview) Fix long-running UI operation to run outside of UI thread +- Remove duplicated annotations in Snyk Code ## [2.7.8] ### Fixed diff --git a/src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt b/src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt index ef0fa8e61..ae2c05117 100644 --- a/src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt +++ b/src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt @@ -58,7 +58,6 @@ class LanguageServerWrapper( /** * The language client is used to receive messages from LS */ - @Suppress("MemberVisibilityCanBePrivate") lateinit var languageClient: SnykLanguageClient /** diff --git a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt index 34ce89dac..5a43059e8 100644 --- a/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt +++ b/src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt @@ -175,6 +175,12 @@ class SnykLanguageClient : LanguageClient { val map = snykScan.issues .groupBy { it.filePath } .mapNotNull { (file, issues) -> SnykCodeFile(project, file.toVirtualFile()) to issues.sorted() } + .map { + // initialize all calculated values before they are needed, so we don't have to do it in the UI thread + it.first.relativePath + it.second.forEach { i -> i.textRange } + it + } .filter { it.second.isNotEmpty() } .toMap() return map.toSortedMap(SnykCodeFileIssueComparator(map)) diff --git a/src/main/resources/META-INF/optional/withCsharp.xml b/src/main/resources/META-INF/optional/withCsharp.xml index 846bba4d8..418f6d0aa 100644 --- a/src/main/resources/META-INF/optional/withCsharp.xml +++ b/src/main/resources/META-INF/optional/withCsharp.xml @@ -1,6 +1,4 @@ - - diff --git a/src/main/resources/META-INF/optional/withGo.xml b/src/main/resources/META-INF/optional/withGo.xml index 3efa1d886..142bd28e2 100644 --- a/src/main/resources/META-INF/optional/withGo.xml +++ b/src/main/resources/META-INF/optional/withGo.xml @@ -2,9 +2,5 @@ - - - - diff --git a/src/main/resources/META-INF/optional/withHTML.xml b/src/main/resources/META-INF/optional/withHTML.xml index cdc6a17ed..418f6d0aa 100644 --- a/src/main/resources/META-INF/optional/withHTML.xml +++ b/src/main/resources/META-INF/optional/withHTML.xml @@ -1,6 +1,4 @@ - - diff --git a/src/main/resources/META-INF/optional/withJava.xml b/src/main/resources/META-INF/optional/withJava.xml index 6215e4aeb..57c5d7cae 100644 --- a/src/main/resources/META-INF/optional/withJava.xml +++ b/src/main/resources/META-INF/optional/withJava.xml @@ -2,9 +2,5 @@ - - - - diff --git a/src/main/resources/META-INF/optional/withJavaScript.xml b/src/main/resources/META-INF/optional/withJavaScript.xml index 021496bfd..418f6d0aa 100644 --- a/src/main/resources/META-INF/optional/withJavaScript.xml +++ b/src/main/resources/META-INF/optional/withJavaScript.xml @@ -1,6 +1,4 @@ - - diff --git a/src/main/resources/META-INF/optional/withKotlin.xml b/src/main/resources/META-INF/optional/withKotlin.xml index f7570358c..8995548a6 100644 --- a/src/main/resources/META-INF/optional/withKotlin.xml +++ b/src/main/resources/META-INF/optional/withKotlin.xml @@ -1,7 +1,5 @@ - - diff --git a/src/main/resources/META-INF/optional/withPHP.xml b/src/main/resources/META-INF/optional/withPHP.xml index b3499a289..418f6d0aa 100644 --- a/src/main/resources/META-INF/optional/withPHP.xml +++ b/src/main/resources/META-INF/optional/withPHP.xml @@ -1,6 +1,4 @@ - - diff --git a/src/main/resources/META-INF/optional/withPython.xml b/src/main/resources/META-INF/optional/withPython.xml index 535e84c2d..418f6d0aa 100644 --- a/src/main/resources/META-INF/optional/withPython.xml +++ b/src/main/resources/META-INF/optional/withPython.xml @@ -1,6 +1,4 @@ - - diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 86b8acfb7..35bc8107e 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -43,7 +43,7 @@