Open karthiknadig opened 8 months ago
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.
@snowsignal would you mind testing if this is fixed with ruff server
?
This happens because VSCode (or IDEs) expect positions to be calculated using the
positionEncoding
(see Client capability).pygls
has convenient helpers for this, seePositionCodec
.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).