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 #134 received at 58790 <at> debbugs.gnu.org (full text, mbox):

From: Danny Freeman <danny <at> dfreeman.email>
To: João Távora <joaotavora <at> gmail.com>
Cc: Felician Nemeth <felician.nemeth <at> gmail.com>, 58790 <at> debbugs.gnu.org,
 Michael Albinus <michael.albinus <at> gmx.de>,
 Stefan Kangas <stefankangas <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server
Date: Wed, 16 Nov 2022 17:59:08 -0500
João Távora <joaotavora <at> gmail.com> 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. 

João 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 reasonably do about the problem that a later system
> can't, except maybe informing that it was the LSP server who is the source 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 server 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.  

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/user.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.

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