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

Use UTF-16 to get the correct position #317

Merged
merged 3 commits into from
May 18, 2023
Merged

Conversation

wrvsrx
Copy link
Contributor

@wrvsrx wrvsrx commented May 12, 2023

Fix zk-org/zk-nvim#69.

According to https://pkg.go.dev/go.lsp.dev/protocol#Position, "The offsets are based on a UTF-16 string representation".

Other code that uses protocol.Position may also have similar issues, but I only fixed the part that affects autocompletion.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

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

zk is using tliron/glsp, but according to the LSP specification UTF-16 offsets are the default, unless specified otherwise. So I guess that applies too.

Thanks for taking the time to send a fix.

@mickael-menu mickael-menu merged commit 6252e51 into zk-org:main May 18, 2023
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.

Bug: completion window doesn't popup when there's non ascii character ahead
2 participants