Skip to content

Commit 15024f6

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 dffd692 commit 15024f6

File tree

2 files changed

+146
-121
lines changed

2 files changed

+146
-121
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ class SarifService {
134134
val element = Leaf(
135135
leafName = result.message.text ?: "",
136136
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}" }
137+
steps = result.codeFlows?.get(0)?.threadFlows?.get(0)?.locations?.map {
138+
"${it.location.physicalLocation.artifactLocation.uri}:" +
139+
"${it.location.physicalLocation.region.startLine}:" +
140+
"${it.location.physicalLocation.region.startColumn}:" +
141+
"${it.location.physicalLocation.region.endLine}:" +
142+
"${it.location.physicalLocation.region.endColumn}"
143+
}
138144
?: listOf(),
139145
location = result.locations[0].physicalLocation.artifactLocation.uri,
140146
ruleId = result.ruleId,

0 commit comments

Comments
 (0)