bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Danny Freeman
Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Thu, 03 Nov 2022 13:10:32 -0400

João Távora <joaotavora@gmail.com> writes:

> I think it's better to patch eglot--uri-to-path so that if X looks
> anything other than file://, Eglot leaves it untouched.  After all, it's
> the only safe translation Eglot can make.

I've attached patch
0001-Only-handle-file-type-URIs-in-eglot-explicitly.patch
to this email that does this pretty well

> And in eglot--path-to-uri, we do likewise.  If the PATH argument already
> looks vaguely URIish (say, it makes something like "^[[:alnum:]]+://")
> we leave it unchanged.

This is done by just trying to parse the path as a URL and checking the
url-type instead of checking a regex.

> Felicián also suggested that Eglot warns the user when it doesn't know
> an URI scheme.  I think that can make sense in some situations, for now
> let's assume it isn't as important as getting your new Jar
> file-name-handler to integrate with Eglot.  Maybe in some later patch
> Eglot can somehow predict if there is a file-name-handler entry for a
> given URI and only warn if there isn't.

This change is only a matter of consulting the `find-file-name-handler`
function. I added another patch for that as
0002-Warn-when-eglot-receives-a-non-file-type-URI-that-Em.patch

Attachment: 0001-Only-handle-file-type-URIs-in-eglot-explicitly.patch
Description: 0001-Only-handle-file-type-URIs-in-eglot-explicitly.patch

Attachment: 0002-Warn-when-eglot-receives-a-non-file-type-URI-that-Em.patch
Description: 0002-Warn-when-eglot-receives-a-non-file-type-URI-that-Em.patch

-- 
Danny Freeman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]