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: Wed, 16 Nov 2022 17:59:08 -0500 Message-ID: <87v8nejy32.fsf@dfreeman.email> References: <9bb290c8-f000-31d8-265d-b5441c33eb38@dfreeman.email> <4d50b820-7053-75eb-5b11-d3d36a02b013@dfreeman.email> <87v8nxsrq6.fsf@gmail.com> <87cza40xgs.fsf@dfreeman.email> <83edubrvf0.fsf@gnu.org> <87cz9v9irh.fsf@gmail.com> <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> Reply-To: Danny Freeman Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Felician Nemeth , 58790@debbugs.gnu.org, Michael Albinus , Stefan Kangas , Dmitry Gutov , Eli Zaretskii To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 17 00:10:27 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 1ovRY3-00032Q-6x for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Nov 2022 00:10:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovRXg-0004hZ-MW; Wed, 16 Nov 2022 18:10:04 -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 1ovRXf-0004gL-3G for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2022 18:10: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 1ovRXe-0004hB-QJ for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2022 18:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovRXe-00051k-F8 for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2022 18:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Nov 2022 23:10:02 +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.166864018819298 (code B ref 58790); Wed, 16 Nov 2022 23:10:02 +0000 Original-Received: (at 58790) by debbugs.gnu.org; 16 Nov 2022 23:09:48 +0000 Original-Received: from localhost ([127.0.0.1]:58448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovRXP-00051C-Sv for submit@debbugs.gnu.org; Wed, 16 Nov 2022 18:09:48 -0500 Original-Received: from out0.migadu.com ([94.23.1.103]:36692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovRXM-00050z-1H for 58790@debbugs.gnu.org; Wed, 16 Nov 2022 18:09:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1668640182; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UjB944UWSoriAEldP2RoiSsM4GRFsW0uX44EweJyLwk=; b=SUJ3EHMqahnt+b4OcW1zYMjHtd2HsXBJ4jcwi51Ypays9NWXp9logmgEUJyO53F85JAS2f +TZy3rG4UrzDpznRgoxDqCQ3a3E0trtuNeIrMQxIGjfhKQkxnqoSryeyIaa+ZYZ6t8cjU6 JANbH1otewTy1cfu2a3kqLn9Mh5H1QE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: 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:248056 Archived-At: Jo=C3=A3o T=C3=A1vora writes: Michael writes: > url-handlers.el supports already non-canonical schemes, see > `url-tramp-protocols'. We could add "jar" and "zipfile" to another user > option, `url-archive-protocols', and let tramp-archive.el do the job. I think this could be a nice thing to include in emacs itself. I have already implemented this funcitonality in a package on elpa: https://elpa.gnu.org/packages/jarchive.html if you want to look.=20 Jo=C3=A3o writes: > I think you're right. Let's not do this patch > It's not Eglot's responsibility, or at least there's nothing Eglot can re= asonably do about the problem that a later system > can't, except maybe informing that it was the LSP server who is the sourc= e of the unknown URL scheme. I'm not sure it > is worth the trouble, but let others speak their mind. This seems reasonable to me. > > Do you (or Danny) have a recipe I could follow? > Danny would, probably, but the recipe would involve a particular LSP serv= er and clojure toolchain, i think. Indeed I do :) >From emacs master branch. The only extra package that needs to be installed is clojure-mode. I have a repository here that should be cloned https://git.sr.ht/~dannyfreeman/eglot-xref-to-jar-repo It contains a nixos shell to install everything automatically if you use that kind of thing. If not, you need to have a recent version of openjdk installed, anything over version 11 will do.=20=20 The clojure command line tool needs to be installed: https://clojure.org/guides/install_clojure (it's also in most linux distro package managers) Clojure-lsp needs to be installed: https://clojure-lsp.io/installation/ Even if you use the nixos shell, this following step is required: Running the `clojure -Stree` command in that git repo to install clojure dependencies. >From there, opening the repository in emacs to this line: https://git.sr.ht/~dannyfreeman/eglot-xref-to-jar-repo/tree/main/item/src/u= ser.clj#L4 Running `M-x eglot` Then `M-x xref-find-definitions` over the symbol `inc` should reproduce the error. I have not found any other lsp servers that do this kind of thing, besides a java one that has even more problems than clojure-lsp. So apologies for the complicated recipe. --=20 Danny Freeman