Skip to content

fix: don't panic on seeing an unexpected offset #11182

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

Merged
merged 1 commit into from
Jan 31, 2022
Merged

fix: don't panic on seeing an unexpected offset #11182

merged 1 commit into from
Jan 31, 2022

Conversation

dimbleby
Copy link
Contributor

@dimbleby dimbleby commented Jan 3, 2022

Intended as a fix, or at least a sticking plaster, for #11081.

I have arranged that offset() returns Option<TextSize> instead of going out of bounds; other changes are the result of following the compiler after doing this.

Perhaps there's still an issue here - I suppose the server and client have gotten out of sync and that probably shouldn't happen in the first place? I see that #10138 (comment) suggests what sounds like a more substantial fix which I think might be aimed in this direction. So perhaps that one should be left open to cover such things?

Meanwhile, I hope that not-crashing is a good improvement: and I can confirm that it works out just fine in the repro I have at #11081.

@dimbleby
Copy link
Contributor Author

Anything I can do to encourage review or merge of this MR? Thanks!

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

This seems alright for the time being to prevent the server from repeatedly panicking if the user triggers it without resaving the file(which usually fixes up the issue).

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 31, 2022

@bors bors bot merged commit 0808ade into rust-lang:master Jan 31, 2022
@lnicola
Copy link
Member

lnicola commented Feb 1, 2022

changelog fix (first contribution) don't panic on seeing an unexpected offset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants