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


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Danny Freeman <danny <at> dfreeman.email>
Cc: Felician Nemeth <felician.nemeth <at> gmail.com>, 58790 <at> debbugs.gnu.org, João Távora <joaotavora <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>, Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Thu, 08 Dec 2022 14:46:58 +0100
Danny Freeman <danny <at> dfreeman.email> writes:

Hi Danny,

>> Well, running the test together with your package looks fine. What I
>> don't understand is the following sequence:
>>
>> [client-request] (id:6) Fri Dec  2 17:04:01 2022:
>> (:jsonrpc "2.0" :id 6 :method "textDocument/definition" :params
>> 	  (:textDocument
>> 	   (:uri "file:///usr/local/src/eglot-xref-to-jar-repo/src/user.clj")
>> 	   :position
>> 	   (:line 3 :character 3)))
>> [server-reply] (id:6) Fri Dec  2 17:04:01 2022:
>> (:jsonrpc "2.0" :id 6 :result
>> 	  (:uri "jar:file:///home/albinus/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj" :range
>> 		(:start
>> 		 (:line 923 :character 6)
>> 		 :end
>> 		 (:line 923 :character 9))))
>>
>> That means, that the client (my local Emacs) has asked for
>> "textDocument/definition" on the file user.clj, as indicated by your
>> recipe. The remote server has returned as answer, that this definition is in
>> "jar:file:///home/albinus/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj". This
>> file must be located on the server, because the server cannot know
>> anything about my local configuration, right?
>
> The server should be running on your machine locally, and have access to
> everything Emacs does. It knows the location of that jar because it uses
> the clojure build tool to create a classpath for the project, which
> contains the full location of the clojure-1.10.3.jar file.

???

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.

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

Best regards, Michael.




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.