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

Correctly handle UTF-16 offsets #7

Open
fhs opened this issue May 31, 2019 · 0 comments
Open

Correctly handle UTF-16 offsets #7

fhs opened this issue May 31, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@fhs
Copy link
Collaborator

fhs commented May 31, 2019

LSP uses UTF-16 offsets:

A position inside a document (see Position definition below) is expressed as a zero-based line and character offset. The offsets are based on a UTF-16 string representation. So a string of the form a𐐀b the character offset of the character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16.

Acme uses rune offsets. Currently, we treat the UTF-16 offsets as rune offsets (and vice versa) for an easier implementation, which is obviously wrong.

@fhs fhs added the bug Something isn't working label May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant