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

Negotiate LSP Position Encoding #5894

Merged
merged 1 commit into from
Feb 11, 2023

Conversation

pascalkuthe
Copy link
Member

So far LSP always required that PositionEncoding.characters is an UTF-16 offset. Now that LSP 3.17 is available in lsp-types request the server to send char offsets (UTF-32) or byte offsets (UTF-8) instead. For compatability with servers that don't support other encodings, UTF-16 is used as a fallback as required by the standard.

@pascalkuthe pascalkuthe added 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 Feb 9, 2023
@pascalkuthe pascalkuthe force-pushed the encoding_negotiation branch 2 times, most recently from 75f2d8a to 9b310da Compare February 9, 2023 19:26
helix-lsp/src/client.rs Outdated Show resolved Hide resolved
helix-lsp/src/lib.rs Show resolved Hide resolved
helix-lsp/src/lib.rs Outdated Show resolved Hide resolved
So far LSP always required that `PositionEncoding.characters` is an
UTF-16 offset. Now that LSP 3.17 is available in `lsp-types` request
the server to send char offsets (UTF-32) or byte offsets (UTF-8)
instead. For compatability with old servers, UTF-16 remains as the
fallback as required by the standard.
@archseer archseer merged commit 93c7afc into helix-editor:master Feb 11, 2023
@pascalkuthe pascalkuthe deleted the encoding_negotiation branch April 30, 2023 21:45
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 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