Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server

From: Richard Copley <[email-masked]>
Date: Wed, 23 Nov 2022 12:49:17 +0000

On Wed, 23 Nov 2022 at 12:43, Arash Esbati <[email-masked]> wrote:
>
> João Távora <[email-masked]> writes:
>
> > 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
> >       ...)

Thanks, yes.

> > 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.

I don't think "url-generic-parse-url" needs any fix. It is for parsing a URL,
not deciding if something is a URL.

> Have a look at bug#59338: Danny came up with a patch for eglot.el.
>
>   https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-11/msg01510.html
>
> Best, Arash

Excellent.