-
-
Notifications
You must be signed in to change notification settings - Fork 722
refactor(language_server): use Message span for Diagnostic's Range #14600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(language_server): use Message span for Diagnostic's Range #14600
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the language server's diagnostic handling to prioritize primary spans when creating LSP diagnostic ranges. Previously, the code always used the first available span for positioning, but now it searches for and uses the primary span when available, falling back to the first span if no primary span exists.
- Enhanced diagnostic positioning logic to use primary spans for more accurate error reporting
- Added fallback mechanism for cases where no spans are available
- Improved the accuracy of diagnostic range reporting in the language server
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
70e1e36 to
1c7fb41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1c7fb41 to
3fec678
Compare
Merge activity
|
3fec678 to
9a589ca
Compare

Now the language server can use the primary span for the diagnostic. This was not possible before.The idea came from @camc314 in a previous PR, when I refactored away the
MessageWithPositionstructUse the message span, it is already the primary span