-
Notifications
You must be signed in to change notification settings - Fork 272
Neovim seems to interpret positions incorrectly #127
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
Comments
I don't get it. Could you please elaborate a bit more? What language server, what test file, what's the expect result, what's the real result you got, etc. |
the language server is one I'm making right now for the lua language. I don't have a release I can share, but I can include:
|
I've tried similar situation with rls as language server, and it doesn't have the described issue. Also, I've verified neovim jumping cursor function, Not sure what's the real cause on your side. But I cannot do much without stable reproduction steps. |
@autozimu If cursor is still used then UTF-8 codeunits/bytes are used to index. I am conducting a survey to inform the debate over what unit ranges should use in the Language Server Protocol. |
Uh oh!
There was an error while loading. Please reload this page.
the LSP spec specifies that positions are (line, character) pairs, where the character describes the offset from the start of the line in UTF-16 code units.
neovim seems to be interpreting them as visual columns instead.
Here are some test cases:
here are the values from my language server (line:character):
test case A is a control.
test case B has a tab character, which is one character that represents 8 columns
test case C has an emoji, which should be counted as two utf 16 code units
EDIT: C seems to be a goof on my part (I sent bytes instead of code units), I'll leave it as an example but neovim has the correct behavior here
The text was updated successfully, but these errors were encountered: