Skip to content

Commit e363e9c

Browse files
fix: remove kotlin specific code that could fail in non-kotlin IDEs (#466)
* chore: remove intellij specific config/code * docs: update CHANGELOG.md * chore: re-add kotlin plugin to platform plugins
1 parent 525333f commit e363e9c

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Snyk Changelog
22

3+
## [2.6.1]
4+
### Fixed
5+
- remove more intellij-specific code and configuration
6+
37
## [2.6.1]
48
### Fixed
59
- don't use kotlin library on non-kotlin IDEs

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ dependencies {
7070
// read more: https://github.com/JetBrains/gradle-intellij-plugin
7171
intellij {
7272
version.set(properties("platformVersion"))
73-
73+
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
74+
// type.set("GO")
7475
downloadSources.set(properties("platformDownloadSources").toBoolean())
7576

7677
// plugin dependencies: uses `platformPlugins` property from the gradle.properties file.

src/main/kotlin/io/snyk/plugin/ui/toolwindow/SnykTreeCellRenderer.kt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import io.snyk.plugin.ui.toolwindow.nodes.root.RootSecurityIssuesTreeNode
2424
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.ErrorTreeNode
2525
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.FileTreeNode
2626
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.SnykCodeFileTreeNode
27-
import org.jetbrains.kotlin.idea.base.util.letIf
2827
import snyk.common.ProductType
2928
import snyk.common.SnykError
3029
import snyk.container.ContainerIssue
@@ -73,10 +72,12 @@ class SnykTreeCellRenderer : ColoredTreeCellRenderer() {
7372
append(fileVulns.sanitizedTargetFile)
7473
append(ProductType.OSS.getCountText(value.childCount))
7574
}
76-
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
77-
"..." + it.substring(
78-
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
79-
)
75+
text = toolTipText.apply {
76+
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
77+
"..." + this.substring(
78+
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
79+
)
80+
}
8081
}
8182

8283
val snykCachedResults = getSnykCachedResults(value.project)
@@ -111,10 +112,12 @@ class SnykTreeCellRenderer : ColoredTreeCellRenderer() {
111112
append(productType.getCountText(value.childCount))
112113
}
113114

114-
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
115-
"..." + it.substring(
116-
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
117-
)
115+
text = toolTipText.apply {
116+
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
117+
"..." + this.substring(
118+
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
119+
)
120+
}
118121
}
119122

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

140-
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
141-
"..." + it.substring(
142-
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length
143-
)
143+
text = toolTipText.apply {
144+
if (toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) {
145+
"..." + this.substring(
146+
this.length - MAX_FILE_TREE_NODE_LENGTH, this.length
147+
)
148+
}
144149
}
145150

146151
val snykCachedResults = getSnykCachedResults(value.project)

0 commit comments

Comments
 (0)