feat: navigate to column on top of line #76
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily includes changes to the
SarifService
andSarifViewerWindowFactory
classes in thesarifviewer
package to enhance the handling of source code locations. The changes involve the addition of column information to theLeaf
class and theopenFile
method, and an adjustment to the column number in theopenFile
method.Here are the key changes:
Changes to the
SarifService
class:src/main/kotlin/com/github/adrienpessu/sarifviewer/services/SarifService.kt
: TheLeaf
object now includes column information in theaddress
andsteps
fields. Previously, these fields only contained the URI and start line. Now, they also include the start column, providing more precise location information. If the start column is not available, it defaults to 0.Changes to the
SarifViewerWindowFactory
class:src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt
: TheopenFile
method now accepts an additional parameter for the column number. This change is reflected where the method is invoked, such as in themouseClicked
event and when opening a file. The column number passed toopenFile
is now extracted from theaddress
field of thecurrentLeaf
object.src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt
: The column number passed to thenavigate
method of theFileEditorManager
instance is reduced by 1 to correctly align with the zero-based indexing of columns in the editor.