unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 61726@debbugs.gnu.org, joaotavora@gmail.com
Subject: bug#61726: [PATCH] Eglot: Support positionEncoding capability
Date: Thu, 23 Feb 2023 19:52:41 +0100	[thread overview]
Message-ID: <87lekodxja.fsf@gmail.com> (raw)
In-Reply-To: <83v8jspgnr.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Feb 2023 17:04:08 +0200")

On Thu, 23 Feb 2023 at 17:04, Eli Zaretskii wrote:

> Then why does Eglot want to know the column at all?

In the Eglot context, "column" simply means "offset since the beginning
of the line", where "offset" can be counted in one of three diferent
ways: codepoints, bytes of the UTF-8 representation, or bytes of the
UTF-16 representation divided by two (a.k.a. code units).

(Number of cells occupied in the terminal is _not_ one of the ways to
count "offset", thankfully!)

I don't think "column" is a particularly confusing name here, but if you
want to rename this, now might be a good opportunity.

>> If you look carefully at the Eglot code, you will see that
>> `move-to-column' only appears in the code pertaining the “UTF-16 way of
>> counting offsets”, which
>> 
>> 1. is old and I didn't touch in this patch,
>> 2. seems to work correctly, despite looking suspicious, and
>> 3. will not be used anymore when both Eglot and the LSP server supports
>>    the positionEncodings capabitily.
>
> Positions do not necessarily transform to columns easily.  So,
> depending on how Eglot uses this information, we may or may not have
> problems.
>
> 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.





  reply	other threads:[~2023-02-23 18:52 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  8:05 bug#61726: [PATCH] Eglot: Support positionEncoding capability Augusto Stoffel
2023-02-23 10:39 ` Eli Zaretskii
2023-02-23 11:32   ` João Távora
2023-02-23 12:04     ` Augusto Stoffel
2023-02-23 12:24       ` João Távora
2023-02-23 11:46   ` Augusto Stoffel
2023-02-23 12:54     ` Eli Zaretskii
2023-02-23 13:31       ` Augusto Stoffel
2023-02-23 15:04         ` Eli Zaretskii
2023-02-23 18:52           ` Augusto Stoffel [this message]
2023-02-23 19:20             ` Eli Zaretskii
2023-02-23 19:28               ` João Távora
2023-02-23 19:52                 ` Augusto Stoffel
2023-02-24  6:43                   ` Eli Zaretskii
2023-02-24  7:18                     ` Augusto Stoffel
2023-02-24  8:38                       ` Eli Zaretskii
2023-02-24  9:15                         ` Augusto Stoffel
2023-02-24 10:20                           ` João Távora
2023-02-24 11:01                             ` Augusto Stoffel
2023-02-24 11:18                               ` João Távora
2023-02-24 11:47                                 ` Augusto Stoffel
2023-02-24 12:05                                   ` João Távora
2023-02-24 12:14                                     ` Augusto Stoffel
2023-02-24 11:38                               ` Eli Zaretskii
2023-02-24 11:55                                 ` João Távora
2023-02-24 11:27                           ` Eli Zaretskii
2023-02-24 11:43                             ` João Távora
2023-02-24 11:57                               ` Eli Zaretskii
2023-02-24 12:09                                 ` João Távora
2023-02-24 12:18                                   ` Eli Zaretskii
2023-02-24 12:31                                     ` Augusto Stoffel
2023-02-24 12:01                             ` Augusto Stoffel
2023-02-24 12:16                               ` Eli Zaretskii
2023-02-24 12:35                                 ` Augusto Stoffel
2023-02-24 12:55                                   ` João Távora
2023-02-24 13:34                                   ` Eli Zaretskii
2023-02-24 13:45                                     ` João Távora
2023-02-24 13:51                                       ` Eli Zaretskii
2023-02-24 14:45                                         ` Augusto Stoffel
2023-02-24 15:19                                           ` Eli Zaretskii
2023-02-24 15:52                                             ` Augusto Stoffel
2023-02-24 16:01                                               ` Eli Zaretskii
2023-02-24 16:39                                                 ` Augusto Stoffel
2023-02-24 17:07                                                   ` Eli Zaretskii
2023-02-24 18:08                                                 ` Augusto Stoffel
2023-02-24 18:55                                                   ` João Távora
2023-02-25 10:58                                                     ` Eli Zaretskii
2023-03-05 10:26                                                     ` Augusto Stoffel
2023-02-25 10:57                                                   ` Eli Zaretskii
2023-02-25 11:29                                                     ` Augusto Stoffel
2023-02-25 13:47                                                       ` Eli Zaretskii
2023-02-25 14:14                                                         ` Augusto Stoffel
2023-02-25 16:26                                                           ` Eli Zaretskii
2023-02-25 18:10                                                             ` Augusto Stoffel
2023-02-25 22:15                                                               ` João Távora
2023-02-25 22:13                                                             ` João Távora
2023-02-25 22:34                                                               ` Augusto Stoffel
2023-02-25 23:16                                                                 ` João Távora
2023-02-25 23:57                                                                   ` Augusto Stoffel
2023-02-26  6:03                                                                     ` Eli Zaretskii
2023-02-26 10:33                                                                       ` João Távora
2023-02-26 13:13                                                                         ` João Távora
2023-02-26 13:16                                                                           ` Eli Zaretskii
2023-02-26 13:25                                                                           ` Eli Zaretskii
2023-02-26 14:17                                                                             ` João Távora
2023-02-26 14:50                                                                               ` Eli Zaretskii
2023-02-26 15:15                                                                                 ` João Távora
2023-02-26 15:37                                                                                   ` Eli Zaretskii
2023-02-27 11:15                                                                                     ` João Távora
2023-02-26  5:31                                                               ` Eli Zaretskii
2023-02-26 10:38                                                                 ` João Távora
2023-02-24 14:54                                       ` Augusto Stoffel
2023-02-24 15:23                                         ` Eli Zaretskii
2023-02-24 15:56                                           ` Augusto Stoffel
2023-02-24 17:02                                             ` Eli Zaretskii
2023-02-24 16:34                                         ` João Távora
2023-02-24 17:06                                           ` Eli Zaretskii
2023-02-23 11:37 ` João Távora
2023-02-23 17:01 ` Felician Nemeth
2023-02-23 17:11   ` João Távora
2023-02-23 18:42   ` Augusto Stoffel
2023-02-27 10:11     ` Felician Nemeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lekodxja.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=61726@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).