]> git.eshelyaron.com Git - emacs.git/commit
Eglot: Only handle URIs with the file:// scheme (bug#58790)
authordannyfreeman <danny@dfreeman.email>
Thu, 3 Nov 2022 13:39:16 +0000 (09:39 -0400)
committerJoão Távora <joaotavora@gmail.com>
Thu, 10 Nov 2022 22:39:09 +0000 (22:39 +0000)
commit1a2d603bb3938ff68ed1a5412d131b41efd40a24
tree358d7b2c83eb86d97633838451a857ee496d18a9
parentc3b64985aa6f61886a24974836635284c86478ef
Eglot: Only handle URIs with the file:// scheme (bug#58790)

Eglot will not attempt to parse URIs that are not file:// type at all.
Instead let 'file-name-handler-alist' entries to deal with those.  Not
parsing them at all allows the 'file-name-handler-alist' regexps to
identify them more accurately.

By also checking if Eglot received a URI in 'eglot--path-to-uri',
'file-name-handler-alist' can provide the non-file type URI back to
the lsp server, which presumably will know how to handle them since it
is also giving them out to clients.

This issue originated with clojure-lsp sending clients "jar:" type
URIs that Emacs is unable to handle out of the box.  Before this
change, "jar:" URIs were parsed once, but since they contain a nested
URI, this resulted in a file being dispatched with a partially parsed
path that looked like "file://path/to.jar!/path/in/jar".

* lisp/progmodes/eglot.el (eglot--path-to-uri): Noop if already an
URI.  (eglot--uri-to-path):  Only handle file:// URIs
lisp/progmodes/eglot.el