Skip to content

Commit

Permalink
fix: remove kotlin specific code that could fail in non-kotlin IDEs (#…
Browse files Browse the repository at this point in the history
…466)

* chore: remove intellij specific config/code

* docs: update CHANGELOG.md

* chore: re-add kotlin plugin to platform plugins
  • Loading branch information
bastiandoetsch authored Jan 17, 2024
1 parent 525333f commit e363e9c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Snyk Changelog

## [2.6.1]
### Fixed
- remove more intellij-specific code and configuration

## [2.6.1]
### Fixed
- don't use kotlin library on non-kotlin IDEs
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ dependencies {
// read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
version.set(properties("platformVersion"))

// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
// type.set("GO")
downloadSources.set(properties("platformDownloadSources").toBoolean())

// plugin dependencies: uses `platformPlugins` property from the gradle.properties file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import io.snyk.plugin.ui.toolwindow.nodes.root.RootSecurityIssuesTreeNode
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.ErrorTreeNode
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.FileTreeNode
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.SnykCodeFileTreeNode
import org.jetbrains.kotlin.idea.base.util.letIf
import snyk.common.ProductType
import snyk.common.SnykError
import snyk.container.ContainerIssue
Expand Down Expand Up @@ -73,10 +72,12 @@ class SnykTreeCellRenderer : ColoredTreeCellRenderer() {
append(fileVulns.sanitizedTargetFile)
append(ProductType.OSS.getCountText(value.childCount))
}
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + it.substring(
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
)
text = toolTipText.apply {
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + this.substring(
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
)
}
}

val snykCachedResults = getSnykCachedResults(value.project)
Expand Down Expand Up @@ -111,10 +112,12 @@ class SnykTreeCellRenderer : ColoredTreeCellRenderer() {
append(productType.getCountText(value.childCount))
}

text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + it.substring(
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
)
text = toolTipText.apply {
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + this.substring(
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
)
}
}

nodeIcon = file.icon
Expand All @@ -137,10 +140,12 @@ class SnykTreeCellRenderer : ColoredTreeCellRenderer() {
append(ProductType.IAC.getCountText(value.childCount))
}

text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + it.substring(
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
)
text = toolTipText.apply {
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
"..." + this.substring(
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
)
}
}

val snykCachedResults = getSnykCachedResults(value.project)
Expand Down

0 comments on commit e363e9c

Please sign in to comment.