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

Wrong position when reporting error with emoji strings #358

Open
karthiknadig opened this issue Jan 19, 2024 · 2 comments
Open

Wrong position when reporting error with emoji strings #358

karthiknadig opened this issue Jan 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@karthiknadig
Copy link

This happens because VSCode (or IDEs) expect positions to be calculated using the positionEncoding (see Client capability). pygls has convenient helpers for this, see PositionCodec.
image

Client and Server has to agree on which encoding they use for positions. Clients report the encodings they support via the positionEncoding field of Client Capability (missing this field means UTF-16 by default). Server has to pick one out of the offered encodings (again missing means UTF-16).

@MichaReiser MichaReiser added the bug Something isn't working label Jan 19, 2024
@MichaReiser
Copy link
Member

MichaReiser commented Jan 19, 2024

Thanks for reporting. That's something my Rust LSP rewrite prototype handles already, but we should backport the functionality to our Python version if we can't find the time to finish the prototype soonish.

@MichaReiser
Copy link
Member

MichaReiser commented May 1, 2024

@snowsignal would you mind testing if this is fixed with ruff server?

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

2 participants