File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,11 @@ class SarifViewerWindowFactory : ToolWindowFactory {
459459 if (e != null && e.isAddedPath) {
460460 val leaves = map[e.path.parentPath.lastPathComponent.toString()]
461461 if (! leaves.isNullOrEmpty()) {
462- val leaf = leaves.first { it.address == e.path.lastPathComponent.toString() }
462+ val leaf = try {
463+ leaves.first { it.address == ((e.path.lastPathComponent as DefaultMutableTreeNode ).userObject as Leaf ).address }
464+ } catch (e: Exception ) {
465+ leaves.first()
466+ }
463467
464468 val githubAlertUrl = leaf.githubAlertUrl
465469 .replace(" api." , " " )
@@ -588,7 +592,8 @@ class SarifViewerWindowFactory : ToolWindowFactory {
588592 val mainResults: List <Result > = sarifMainBranch.flatMap { it.runs?.get(0 )?.results ? : emptyList() }
589593
590594 for (currentResult in results) {
591- if (mainResults.none { it.ruleId == currentResult.ruleId && it.message.text == currentResult.message.text }) {
595+ if (mainResults.none { it.ruleId == currentResult.ruleId
596+ && (" ${currentResult.locations[0 ].physicalLocation.artifactLocation.uri} :${currentResult.locations[0 ].physicalLocation.region.startLine} " == " ${it.locations[0 ].physicalLocation.artifactLocation.uri} :${it.locations[0 ].physicalLocation.region.startLine} " ) }) {
592597 resultsToDisplay.add(currentResult)
593598 }
594599 }
You can’t perform that action at this time.
0 commit comments