GNU bug report logs - #72597
30.0.60; Eglot: MarkedString with embedded Carriage Return

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Tue, 13 Aug 2024 01:18:02 UTC

Severity: normal

Found in version 30.0.60

Full log


Message #29 received at 72597 <at> debbugs.gnu.org (full text, mbox):

From: Troy Brown <brownts <at> troybrown.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72597 <at> debbugs.gnu.org, Felician Nemeth <felician.nemeth <at> gmail.com>,
 joaotavora <at> gmail.com
Subject: Re: bug#72597: 30.0.60;
 Eglot: MarkedString with embedded Carriage Return
Date: Wed, 14 Aug 2024 07:41:36 -0400
On Wed, Aug 14, 2024 at 2:37 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Felician Nemeth <felician.nemeth <at> gmail.com>
> > Cc: Troy Brown <brownts <at> troybrown.dev>,  joaotavora <at> gmail.com,
> >   72597 <at> debbugs.gnu.org
> > Date: Wed, 14 Aug 2024 07:54:24 +0200
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > > Can you please answer my question whether this is standard-complying
> > > behavior according to LSP protocol?  IOW, what is the source of the
> > > assumption that CR characters will be interpreted as newlines in these
> > > cases?
> >
> > It seems this is standard-complying, because the specification has this:
> > "To ensure that both client and server split the string into the same
> > line representation the protocol specifies the following end-of-line
> > sequences: ‘\n’, ‘\r\n’ and ‘\r’."
>
> This just caters to the 3 known EOL formats: the Unix, the
> DOS/Windows, and the Mac one.  If this is the basis for the described
> behavior, then Emacs should bind coding-system-for-read when reading
> this stuff, or maybe manually decode the strings after detecting EOL
> format.  But that would only work if the EOL format is used
> consistently in the entire response of the server; if they just use
> the above as a means to sneak in multiple-line responses, and
> otherwise use some other EOL format, then we need to handle a lone \r
> specially in Eglot's code, something I'm not sure we like to do.

Other than what Felician already quoted from the LSP specification,
there doesn't seem to be much else stated about EOL.  In this
particular case, I've seen it on both Linux and Windows, therefore the
use of the CR doesn't seem to be consistent with the platform or the
document format.  It's unclear to me why this particular EOL format
was chosen for the hover information, but I can't find anything in the
specification that says it is incorrect.




This bug report was last modified 1 year and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.