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 didChange notification offset encoding #6921

Merged
merged 1 commit into from
May 1, 2023

Conversation

pascalkuthe
Copy link
Member

@pascalkuthe pascalkuthe commented Apr 30, 2023

Fixes rust-lang/rust-analyzer#14679

In #5894 I overlooked that the incremental sync code manually transcodes char positions to utf16 line/column offset. This could cause server crashes for LSP servers that support utf8 or utf32 when editing on the same line after a non-ascii character.

This issue has been noticed by quite a few people both on matrix and in various github comments (for example #6594 (comment)) altough we don't have an issue for it in our repo

@pascalkuthe pascalkuthe added this to the 23.04 milestone Apr 30, 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 30, 2023
@poliorcetics
Copy link
Contributor

Thanks for fixing it! If this isn't merged by Tuesday, I'll have the test to test it for a work day then

@the-mikedavis the-mikedavis changed the title fix didChange notifaction offset encoding fix didChange notification offset encoding Apr 30, 2023
Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to me!

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.

rust-analyzer errors and shuts down almost constantly
4 participants