Closed Andre0991 closed 1 year ago
Posting a final resolution here. Installing my jarchive package resolves this issue: https://git.sr.ht/~dannyfreeman/jarchive
It's available on ELPA. The eglot-extend-to-xref
setting works with it as well.
@abcdw you may want to update your guix recipe with a newer commit. Thank you for sharing that here.
Hi @dannyfreeman.
I see that there are no new messages in the Emacs bug tracker 1 – will Emacs get a patch too or is jarchive
a permanent solution?
I see that there are no new messages in the Emacs bug tracker 1 – will Emacs get a patch too or is jarchive a permanent solution?
There is still discussion on that ticket in the 2022-11 archives. I think this is the latest message at the time of me writing this. The way the mailing list archives are displayed can be confusing.
The way I see it, jarchive is the solution for now, and it is on ELPA: https://elpa.gnu.org/packages/jarchive.html which is the most available place for it to be next to emacs core IMO.
Maybe down the line jarchive or something like it will make its way into Emacs. I think that would be nice and I'll keep discussing it. Until then ELPA is a nice proving ground for this functionality.
Oh, indeed, I missed the newest messages.
Thank you so much for tackling this – I just installed jarchive
and LSP+Clojure is 100% supported by Emacs now.
FWIW, I just tried jarchive, and it doesn't fix the issue for me. I get an error like this:
Error in post-command-hook (#[0 "\303\304\301\242\305#\210\300\306!\205 r\211q\210
?\205 \307\310\311 \")\207" [#<buffer fs.cljc> (#0) eglot--managed-mode remove-hook post-command-hook nil buffer-live-p apply eglot--connect eglot--guess-contact] 4]): (file-missing "Setting current directory" "No such file or directory" "/Users/user/.m2/repository/babashka/fs/0.1.2/fs-0.1.2.jar::babashka/")
Hi. I'm experimenting with using
eglot
with Clojure.I've had no issues so far except that
xref-find-definitions
won't work for external dependencies. When I use it on some symbol that refers to an external lib, Emacs asks me if I want to create the directory:The expected behaviour would be to open a buffer with the contents of the file in the jar (and manage it in the same project? Not sure).
Here's the an eglot log sample for this issue:
Steps to reproduce
Download the
clojure
binaryDownload the native clojure-lsp binary in https://github.com/clojure-lsp/clojure-lsp/releases
Configure
eglot
to use itClone
clj-new
and install its dependencies.Open the project in
Emacs
, go toclj-new/src/clj/generate/def.clj
and usexref-find-definitions
on some external lib likeclojure.java.io
(line 5 in this file).Note: I'm using Doom Emacs. I think this does not affect anything in regards to this behaviour. Unfortunately, I don't have a clean Emacs for confirming this easily right now. If you suspect this is Doom specific, I can setup a barebones Emacs in a few days.