I'm using clojure-lsp via eglot, and xref-find-definitions works fine for symbols in the project, but it doesn't work if I'm navigating to a function in a library. Emacs just shows a blank buffer with a ns like the following:
(ns my.project.zipfile:.Users.gunnar..m2.repository.no.cjohansen.powerpack.2025.01.21.powerpack-2025.01.21.jar::powerpack.dev)
... where was the ns I was trying to visit. I'm thinking that there's something obvious that I'm not seeing here, so any help is appreciated 🙂I assume you get the correct jump behavior if you start Emacs with: emacs --no-init-file .
Probably a mix of a local class-path issue and some package that auto-generates a ns declaration when a new clj file is created.
If I use Cider for xref then everything works as expected. (Should have mentioned that.)
I'll try creating a clean and minimal config and see if my config is to blame. Thanks!
it looks like clojure-lsp is not finding http://powerpack.dev in classpath or something, check https://clojure-lsp.io/troubleshooting/#server-log for the classpath used by clojure-lsp, it will help understand
Thaks for the tip, @ericdallo. The classpath seems to be correct, though. I'll try with a minimal repro, both clj-project and emacs config, and if that fails, I'll try with lsp-mode instead of eglot. Will report back.
I created a repro with a basic clj project and minimal emacs config:
• eglot has the same behaviour
• lsp-mode works as expected
So I digged on and found this: https://github.com/joaotavora/eglot/issues/661
It's a known issue, and it hasn't been solved yet, but it can be handled by installing and running jarchive-mode:
https://sr.ht/~dannyfreeman/jarchive/#working-with-eglot
Thanks again, @hkjels and @ericdallo for nudging me in the right direction 🙂
Ahh. I have jarchive-mode installed indeed.