Subject: Re: bug#61726: [PATCH] Eglot: Support positionEncoding capability

From: Augusto Stoffel <[email-masked]>
Date: Thu, 23 Feb 2023 20:52:06 +0100

On Thu, 23 Feb 2023 at 19:28, João Távora wrote:

>> > > In general, reporting coordinates in columns between programs is
>> > > problematic.  We see this in many cases, starting with spellers.
>> >
>> > Yes, I agree this is problematic -- as soon as you leave the wonderful
>> > world of UTF-8.  The point of this patch is to stay in that wonderful
>> > world as long as the server agrees to it, which I hope will become
>> > commonplace.
>>
>> Actually, the really "wonderful" world would be if the offsets were
>> reported in character codepoints, because buffer positions are both
>> the easiest for us to count and are unequivocally defined.
>
> I quite agree.

Yes, everybody agrees!

> Is this "count in codepoints" capability defined in LSP at all?

That's _exactly_ what the patch implements 🥳.

And then it also provides a second option, which is to use "bytes of the
UTF-8 representation" as the unit of measurement.  And then only as the
third option it falls back to the "LSP abiding" nonsense.