all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Danny Freeman <danny@dfreeman.email>
Cc: "Felician Nemeth" <felician.nemeth@gmail.com>,
	58790@debbugs.gnu.org, "João Távora" <joaotavora@gmail.com>,
	"Dmitry Gutov" <dgutov@yandex.ru>, "Eli Zaretskii" <eliz@gnu.org>,
	"Stefan Kangas" <stefankangas@gmail.com>
Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Fri, 09 Dec 2022 17:04:25 +0100	[thread overview]
Message-ID: <87h6y4pnqu.fsf@gmx.de> (raw)
In-Reply-To: <87cz8tvh9q.fsf@dfreeman.email> (Danny Freeman's message of "Thu,  08 Dec 2022 14:07:59 -0500")

Danny Freeman <danny@dfreeman.email> writes:

Hi Danny,

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

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

--8<---------------cut here---------------start------------->8---
[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")])
--8<---------------cut here---------------end--------------->8---

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@host:/usr/local/src/emacs/src/dbusbind.c".

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

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.





  reply	other threads:[~2022-12-09 16:04 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 21:44 bug#58790: Eglot URI parsing bug when using clojure-lsp server Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-26  6:22 ` Stefan Kangas
2022-10-26 19:50   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-27 15:09     ` João Távora
2022-10-29  1:22       ` Dmitry Gutov
2022-10-29  2:02         ` João Távora
2022-10-29 14:54           ` Dmitry Gutov
2022-10-29 19:35             ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-31 14:40               ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-02  8:09                 ` João Távora
2022-11-02 13:15                   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-03 17:10                   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10  9:49                     ` Eli Zaretskii
2022-11-10 11:00                       ` João Távora
2022-11-10 13:47                         ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 15:38                         ` Eli Zaretskii
2022-11-10 21:45                           ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 21:59                             ` João Távora
2022-11-10 22:22                               ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 22:30                                 ` João Távora
2022-11-10 22:48                                   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 22:48                                 ` João Távora
2022-11-10 22:57                                   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-11  7:29                                   ` Eli Zaretskii
2022-11-12 17:03                                     ` Michael Albinus
2022-11-13 21:04                                       ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-15 19:04                                         ` Michael Albinus
2022-11-15 22:28                                           ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-16  7:53                                             ` Michael Albinus
2022-11-16 10:21                                               ` João Távora
2022-11-16 15:45                                                 ` Michael Albinus
2022-11-16 16:20                                                   ` João Távora
2022-11-16 22:59                                                     ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-02 16:14                                                       ` Michael Albinus
2022-12-07 18:56                                                         ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08 13:46                                                           ` Michael Albinus
2022-12-08 19:07                                                             ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-09 16:04                                                               ` Michael Albinus [this message]
2022-12-10 17:21                                                                 ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-10 17:45                                                                   ` Michael Albinus
2022-11-22 14:30                                                     ` Michael Albinus
2022-11-23 11:55                                                       ` Richard Copley
2022-11-23 12:36                                                         ` João Távora
2022-11-23 12:42                                                           ` Arash Esbati
2022-11-23 12:49                                                             ` Richard Copley
2022-11-23 12:54                                                               ` João Távora
2022-11-23 13:33                                                           ` Eli Zaretskii
2022-11-23 13:44                                                             ` João Távora
2022-11-23 14:03                                                               ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 19:53                                                                 ` João Távora
2022-11-11  8:30                               ` Eli Zaretskii
2022-11-11  9:45                                 ` João Távora
2022-11-11 12:01                                   ` Eli Zaretskii
2022-11-11 14:02                                     ` João Távora
2022-11-11 14:45                                       ` Eli Zaretskii
2022-11-12  9:04                                         ` João Távora
2022-11-11  7:16                             ` Eli Zaretskii
2022-11-01 17:25         ` Juri Linkov
2022-10-29 15:36 ` Felician Nemeth
2022-10-29 17:09   ` João Távora
2022-11-09  0:59 ` bug#58790: Robert Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6y4pnqu.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=58790@debbugs.gnu.org \
    --cc=danny@dfreeman.email \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=joaotavora@gmail.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.