GNU bug report logs - #58790
Eglot URI parsing bug when using clojure-lsp server

Previous Next

Package: emacs;

Reported by: Danny Freeman <danny <at> dfreeman.email>

Date: Wed, 26 Oct 2022 05:08:04 UTC

Severity: normal

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: felician.nemeth <at> gmail.com, danny <at> dfreeman.email, 58790 <at> debbugs.gnu.org,
 rcopley <at> gmail.com, michael.albinus <at> gmx.de, stefankangas <at> gmail.com,
 dgutov <at> yandex.ru
Subject: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Wed, 23 Nov 2022 13:44:48 +0000
[Message part 1 (text/plain, inline)]
On Wed, Nov 23, 2022 at 1:34 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: João Távora <joaotavora <at> gmail.com>
> > Date: Wed, 23 Nov 2022 12:36:37 +0000
> > Cc: Danny Freeman <danny <at> dfreeman.email>, Felician Nemeth <
> felician.nemeth <at> gmail.com>,
> >       58790 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>,
> >       Dmitry Gutov <dgutov <at> yandex.ru>, Eli Zaretskii <eliz <at> gnu.org>,
> >       Michael Albinus <michael.albinus <at> gmx.de>
> >
> > Yes,I think I follow.  To be clear I think the problem is somewhere in
> >
> > (defun eglot--path-to-uri (path)
> >   "URIfy PATH."
> >   (let ((truepath (file-truename path)))
> >     (if (url-type (url-generic-parse-url truepath))
> >         ;; Path is already a URI, so forward it to the LSP server
> >         ;; untouched.  The server should be able to handle it, since
> >         ;; it provided this URI to clients in the first place.
> >         truepath
> >       ...)
> >
> > So either url-generic-parse-url and url-type is fixed in url-parse.el,
> or
> > we must add some Windows-specific guards in eglot.el.  Or likely
> > both, since url-parse.el is not a :core ELPA package.
> >
> > Richard/Danny, can you perhaps come up with some patch?
>
> From where I stand, the solution was already proposed here:
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59338#53


Right. When I wrote that, I was unaware of this second bug report.


> You said you wanted to augment it with something that didn't depend on
> url-parse.el, because it wasn't in Emacs < 29, but I don't think I
> understand the concern, since AFAICT url-parse.el is in all versions of
> Emacs since at least Emacs 23.  So what am I missing?
>

Maybe I misunderstood, but it seemed like you were proposing that
we change url-parse.el so that  it isn't fooled into thinking windows path
names are URLs with the drive letter as the 'url-type'.

If that were the correct solution (I tend to think it is), then it would
_not_ suffice to fix Eglot on Emacsen older than 29, because url-parse.el
is not distributed separately as a :core ELPA package.

So unless we made url-parse.el such a package, we would need a Danny's
"kludgy" patch to eglot.el anyway.

In any case, I suggest that a solution be based on the patch shown in that
> bug#59338 discussion.
>

Having now read Danny's patch, I think it's good to commit.

João
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 166 days ago.

Previous Next


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