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 #155 received at 58790 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
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 15:33:58 +0200
> 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

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?

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




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.