From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server Date: Sat, 10 Dec 2022 12:21:18 -0500 Message-ID: <87fsdntbpd.fsf@dfreeman.email> References: <83o7terf9a.fsf@gnu.org> <87k042tqze.fsf@dfreeman.email> <87fseqtpiu.fsf@dfreeman.email> <875yfm8lzf.fsf@gmail.com> <83wn82osoo.fsf@gnu.org> <871qq8xfzr.fsf@gmx.de> <87mt8uwo2q.fsf@dfreeman.email> <87zgcs6nvb.fsf@gmx.de> <87r0y3luad.fsf@dfreeman.email> <87iljf72ua.fsf@gmx.de> <87a64qykcf.fsf@gmx.de> <87v8nejy32.fsf@dfreeman.email> <87o7sl6awm.fsf@gmx.de> <87h6y7uioy.fsf@dfreeman.email> <87wn72ovn1.fsf@gmx.de> <87cz8tvh9q.fsf@dfreeman.email> <87h6y4pnqu.fsf@gmx.de> Reply-To: Danny Freeman Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28111"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Felician Nemeth , 58790@debbugs.gnu.org, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Dmitry Gutov , Eli Zaretskii , Stefan Kangas To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 10 18:24:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p43a9-0007AR-H2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Dec 2022 18:24:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p43a3-00057c-Ul; Sat, 10 Dec 2022 12:24:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p43Zy-00056d-AC for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2022 12:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p43Zy-0007Lp-1t for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2022 12:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p43Zx-0001EV-Sa for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2022 12:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Dec 2022 17:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58790 X-GNU-PR-Package: emacs Original-Received: via spool by 58790-submit@debbugs.gnu.org id=B58790.16706929984726 (code B ref 58790); Sat, 10 Dec 2022 17:24:01 +0000 Original-Received: (at 58790) by debbugs.gnu.org; 10 Dec 2022 17:23:18 +0000 Original-Received: from localhost ([127.0.0.1]:44045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p43ZG-0001EA-5u for submit@debbugs.gnu.org; Sat, 10 Dec 2022 12:23:18 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:64854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p43ZC-0001Dp-TL for 58790@debbugs.gnu.org; Sat, 10 Dec 2022 12:23:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1670692993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FZtf18pkZyzy57Net8OSPNxqZJronmCK0fjALnDjrfU=; b=lLzE0yszt/zB4d5yzUwWkdNWDkceVUf2y+HYQ8ryNGD31mUDzpqu9vHmVnnfK8ynjVaFxe j5v+RvUa3nHlmpsZQT3zFN4ubQZnadrHikC+k7VgDSYkdidB5GqhIbDob9UbGvtEkOQU6K aMIOwo140IXdtwP2dBTZT3h0ArI2Opw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87h6y4pnqu.fsf@gmx.de> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250532 Archived-At: Michael Albinus 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@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 > > [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@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