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 kotlin specific code that could fail in non-kotlin IDEs #466

Merged
merged 3 commits into from
Jan 17, 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
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
Loading