Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove duplicated annotator definition [IDE-192] #489

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/snyk/common/lsp/LanguageServerWrapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class LanguageServerWrapper(
/**
* The language client is used to receive messages from LS
*/
@Suppress("MemberVisibilityCanBePrivate")
lateinit var languageClient: SnykLanguageClient

/**
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withCsharp.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="C#" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="C#" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
4 changes: 0 additions & 4 deletions src/main/resources/META-INF/optional/withGo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="vgo" implementationClass="snyk.oss.annotator.OSSGoModAnnotator"/>
<externalAnnotator language="go" implementationClass="snyk.oss.annotator.OSSGoModAnnotator"/>
<externalAnnotator language="vgo" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="vgo" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
<externalAnnotator language="go" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="go" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withHTML.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="HTML" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="HTML" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
4 changes: 0 additions & 4 deletions src/main/resources/META-INF/optional/withJava.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="JAVA" implementationClass="snyk.oss.annotator.OSSMavenAnnotator"/>
<externalAnnotator language="Groovy" implementationClass="snyk.oss.annotator.OSSGradleAnnotator"/>
<externalAnnotator language="JAVA" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="JAVA" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
<externalAnnotator language="Groovy" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="Groovy" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withJavaScript.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="JavaScript" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="JavaScript" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withKotlin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="kotlin" implementationClass="snyk.oss.annotator.OSSGradleAnnotator"/>
<externalAnnotator language="kotlin" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="kotlin" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withPHP.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="PHP" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="PHP" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/optional/withPython.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="Python" implementationClass="snyk.code.annotator.SnykCodeAnnotatorLS"/>
<externalAnnotator language="Python" implementationClass="snyk.code.annotator.SnykCodeAnnotator"/>
</extensions>
</idea-plugin>
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<registryKey key="snyk.preview.snyk.code.ls.enabled"
defaultValue="false"
description="Preview: Use Language Server as Source for Snyk Code findings."
description="Preview: Use language server as source for Snyk Code findings."
restartRequired="true"/>

<notificationGroup id="Snyk" displayType="BALLOON" toolWindowId="Snyk"/>
Expand Down
Loading