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


Message #184 received at 58790 <at> debbugs.gnu.org (full text, mbox):

From: Danny Freeman <danny <at> dfreeman.email>
To: Michael Albinus <michael.albinus <at> gmx.de>
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: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Sat, 10 Dec 2022 12:21:18 -0500
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Yes, this is what it looks like. I don't believe it is an error in the
> LSP server.
>
> The eglot architecture, AFAIU, runs always the the LSP server on the
> same machine as the file under investigation is located on. For local
> files it is obvious: in eglot--connect, make-process is called, which
> connects to the LSP server on the local machine.
>
> If you have a remote file, say
> /ssh:user <at> host:/usr/local/src/emacs/src/dbusbind.c (in order to use a
> more simple LSP server like clangd), they same happens: make-process is
> called. *But* make-process realizes that default-directory is a remote
> one (/ssh:user <at> host:/usr/local/src/emacs/src//), and so it calls clangd
> on that remote host.
>
> That LSP server doesn't care where the client is called from. It still
> does
>
> [client-request] (id:20) Fri Dec  9 16:47:05 2022:
> (:jsonrpc "2.0" :id 20 :method "textDocument/definition" :params
> 	  (:textDocument
> 	   (:uri "file:///usr/local/src/emacs/src/dbusbind.c")
> 	   :position
> 	   (:line 171 :character 0)))
> [server-reply] (id:20) Fri Dec  9 16:47:05 2022:
> (:id 20 :jsonrpc "2.0" :result
>      [(:range
>        (:end
> 	(:character 22 :line 172)
> 	:start
> 	(:character 0 :line 172))
>        :uri "file:///usr/local/src/emacs/src/dbusbind.c")])
>
> So the client requests to get a definition in (the server local) file
> "file:///usr/local/src/emacs/src/dbusbind.c" at a given position, and
> the server replies with a pointer to the (server local) file
> "file:///usr/local/src/emacs/src/dbusbind.c". It is up to the client
> (eglot), to translate this information into remote file name syntax
> "/ssh:user <at> host:/usr/local/src/emacs/src/dbusbind.c".
>

>
> I suppose for clojure the same spplies. If the LSP server on that remote
> host returns something like a (server local) file
> "jar:file:///home/albinus/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar!/clojure/core.clj",
> it is up to the (eglot) client to recognize this as a pointer to the
> remote file at the given location. This problem is not tackled yet by
> your jarchive package.
>
> Best regards, Michael.

Thanks for taking the time to explain more. I understand now, and have
enough information to re-create this scenario myself. Once I do that
I'll see how I can account for this scenario in jarchive. When I do I
will post an update.

-- 
Danny Freeman




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.