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

From: Danny Freeman <[email-masked]>
Date: Thu, 08 Dec 2022 14:07:59 -0500

Michael Albinus <[email-masked]> writes:

>
> ???
>
> I'm speaking about a clojure file which is located on a remote machine,
> accessed via Tramp. I thought that Eglot uses an LSP server on that
> remote machine then.

I wasn't aware you were using tramp, I thought you were attempting to
run clojure-lsp on a remote server to work with a project on a local
machine, which shouldn't work. clojure-lsp needs access to the files,
including jar files, to work properly.

>> From what the clojure-lsp maintainers tell me, it will not run on a
>> remote machine and be able to work with a project on your local machine.
>> I'm not sure what it would return for a definition if it was able to run
>> on a remote machine.
>
> The LSP server shouldn't care. It returns a local file name, like
> "jar:file:///home/albinus/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj". This
> is because the file is local from the server's pov.

> It is the client, Eglot, which must be able to access this file on the
> remote machine. A task for your jarchive file name handler, I believe.
>
> Or do I misunderstand the architecture?

I think I am just confused at this point. Can you explain more about
what your current setup is for this question? In trying to understand,
it sounds like you are using Emacs to connect to a remote machine
somewhere via tramp. On the remote machine is a clojure project and a
running clojure-lsp server. When you try to navigate to a definition in
a jar, it is returning a jar URI pointing to something on your local
machine, not the remote machine like it should? Does that sound right?

Fwiw, I have never used tramp before, so I'm not sure how Eglot or
clojure-lsp will behave in that kind of environment.

-- 
Danny Freeman