Skip to content
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 panic in inlay hint computation when view anchor is out of bounds #6883

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

pascalkuthe
Copy link
Member

Fixes the crash from this comment #6752 (comment)

Note that this crash is not the same crash that #6752 is about and was incorrectly reported there. The problem here is simply that view.offset.anchor was used directly with char_to_line, but the anchor can be out of bounds which causes a crash here. Everywhere else where the anchor is used we currently used anchor.min(doc.len_char()) for that reason. This PR just adds that to the inlay hint computation too since we forgot about it there.

@pascalkuthe pascalkuthe added this to the 23.04 milestone Apr 26, 2023
@pascalkuthe pascalkuthe added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Apr 26, 2023
@archseer archseer merged commit 8f1671e into helix-editor:master Apr 27, 2023
@pascalkuthe pascalkuthe deleted the lsp_crash branch April 27, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants