Skip to content

Commit 7f28832

Browse files
committed
Improve flow step navigation
Flow steps can belong to different parts of the same line. This commit makes selections more precise by including column information from the SARIF step data.
1 parent 9c09263 commit 7f28832

File tree

2 files changed

+175
-112
lines changed

2 files changed

+175
-112
lines changed

Diff for: src/main/kotlin/com/github/adrienpessu/sarifviewer/services/SarifService.kt

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import com.intellij.openapi.components.Service
1414
import com.intellij.util.alsoIfNull
1515
import java.net.HttpURLConnection
1616
import java.net.URL
17-
import java.util.Comparator
18-
import java.util.TreeMap
17+
import java.util.*
1918

2019

2120
@Service(Service.Level.PROJECT)
@@ -134,7 +133,13 @@ class SarifService {
134133
val element = Leaf(
135134
leafName = result.message.text ?: "",
136135
address = "${result.locations[0].physicalLocation.artifactLocation.uri}:${result.locations[0].physicalLocation.region.startLine}",
137-
steps = result.codeFlows?.get(0)?.threadFlows?.get(0)?.locations?.map { "${it.location.physicalLocation.artifactLocation.uri}:${it.location.physicalLocation.region.startLine}" }
136+
steps = result.codeFlows?.get(0)?.threadFlows?.get(0)?.locations?.map {
137+
"${it.location.physicalLocation.artifactLocation.uri}:" +
138+
"${it.location.physicalLocation.region.startLine}:" +
139+
"${it.location.physicalLocation.region.startColumn}:" +
140+
"${it.location.physicalLocation.region.endLine}:" +
141+
"${it.location.physicalLocation.region.endColumn}"
142+
}
138143
?: listOf(),
139144
location = result.locations[0].physicalLocation.artifactLocation.uri,
140145
ruleId = result.ruleId,

0 commit comments

Comments
 (0)