fix: allow navigation to ranges in files which are not IDE documents [IDE-1781]#793
Merged
andrewrobinsonhodges-snyk merged 3 commits intomasterfrom Feb 27, 2026
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
Code Coverage
|
rrama
approved these changes
Feb 27, 2026
| every { appMock.invokeLater(any<Runnable>()) } answers { firstArg<Runnable>().run() } | ||
| every { | ||
| appMock.invokeLater(any<Runnable>(), any<com.intellij.openapi.application.ModalityState>()) | ||
| } answers { firstArg<Runnable>().run() } |
Contributor
There was a problem hiding this comment.
Might want to pull this out as a common test util.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The navigateToSource function used when a user clicks on an issue in the tree view previously validated the range by comparing to the length of the target file as an IDE document.
This mean that we were silently failing to navigate to files that the IDE could not process as a document (e.g., .gitleaksignore). The fix is to log the discrepancy and let the PsiNavigationSupport library handle it. The file will now open, even if the correct range cannot be determined.
Note that we expect that the ranges returned by the Secrets scanner should always be correct, so this was an overly defensive practice.
Checklist
Screenshots / GIFs
Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!