fix : file location resolving and add an error message if it's not resolved #75
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 to
src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.ktincludes changes to improve the handling ofLeafobjects and error notifications for file not found. The most important changes include adding acurrentLeafvariable to store the currentLeafobject, changing the usage ofLeaftocurrentLeaf, and adding error handling when the file is not found.Here are the most important changes:
src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt: Introduced a new private variablecurrentLeafto store the currentLeafobject.src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt: Replaced the localleafvariable withcurrentLeafin several places, making the code more efficient and easier to maintain. [1] [2] [3]src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt: Improved error handling when a file cannot be found by displaying a warning notification.src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt: ImportedNotificationandNotificationsclasses fromcom.intellij.notificationpackage.src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt: Added a check for nullvirtualFilebefore attempting to open the text editor.