-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue description retrieval & styles
- Loading branch information
1 parent
4a0deb6
commit f18123f
Showing
12 changed files
with
112 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 4 additions & 12 deletions
16
src/main/kotlin/io/snyk/plugin/ui/toolwindow/nodes/leaf/SuggestionTreeNode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
package io.snyk.plugin.ui.toolwindow.nodes.leaf | ||
|
||
import io.snyk.plugin.SnykFile | ||
import com.intellij.openapi.project.Project | ||
import io.snyk.plugin.ui.toolwindow.nodes.DescriptionHolderTreeNode | ||
import io.snyk.plugin.ui.toolwindow.nodes.NavigatableToSourceTreeNode | ||
import io.snyk.plugin.ui.toolwindow.nodes.secondlevel.SnykFileTreeNode | ||
import io.snyk.plugin.ui.toolwindow.panels.IssueDescriptionPanelBase | ||
import io.snyk.plugin.ui.toolwindow.panels.SuggestionDescriptionPanelFromLS | ||
import snyk.common.ProductType | ||
import snyk.common.lsp.ScanIssue | ||
import javax.swing.tree.DefaultMutableTreeNode | ||
|
||
class SuggestionTreeNode( | ||
private val issue: ScanIssue, | ||
val project: Project, | ||
val issue: ScanIssue, | ||
override val navigateToSource: () -> Unit | ||
) : DefaultMutableTreeNode(issue), NavigatableToSourceTreeNode, DescriptionHolderTreeNode { | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
override fun getDescriptionPanel(): IssueDescriptionPanelBase { | ||
val snykFileTreeNode = this.parent as? SnykFileTreeNode | ||
?: throw IllegalArgumentException(this.toString()) | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
val entry = | ||
(snykFileTreeNode.userObject as Pair<Map.Entry<SnykFile, List<ScanIssue>>, ProductType>).first | ||
val snykFile = entry.key | ||
return SuggestionDescriptionPanelFromLS(snykFile, issue) | ||
return SuggestionDescriptionPanelFromLS(project, issue) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.