-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix crash on LSP text edits with invalid ranges #9649
Fix crash on LSP text edits with invalid ranges #9649
Conversation
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.
There's also an lsp_range_to_range
helper that handles this case, but it handles it by capping range.start
to range.end
. I think discarding the edit makes more sense in this case. What do you think @pascalkuthe?
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.
Invalid completions already have some logic dedicated to them and I would like to check that there isn't some new bug here before merging this
If there's anything else I can do to help with this issue, please let me know. |
This PR attempts to fix #9624.
While testing helix-gpt out, helix crashed many times for me. I decided to take a shot at fixing this issue myself, with a simple check inside the Transaction change edit's closure. When the range is invalid, I simply discarded the edit and logged it.
As noted in the issue, this is mainly a problem inside helix-gpt itself, but a crash is undesirable.