This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-02
Channels
- # babashka (68)
- # beginners (22)
- # calva (8)
- # cider (10)
- # cljs-dev (31)
- # clojure (35)
- # clojure-europe (6)
- # clojure-norway (17)
- # clojurescript (5)
- # conjure (10)
- # data-science (8)
- # datascript (10)
- # emacs (3)
- # fulcro (20)
- # humbleui (3)
- # london-clojurians (1)
- # membrane (9)
- # nbb (34)
- # off-topic (16)
- # pathom (15)
- # releases (1)
- # shadow-cljs (15)
- # sql (15)
When I use cider and eglot, cider's implementation of xref-find-references
is used, but I would prefer to use eglot's xref implementation. Is there a way for me to tell emacs to use eglot instead of cider? Or a maybe a way to disable cider's xref implementation completely?
I’m not sure how to configure this, but just one warning. eglot
does not handle definitions of external projects (as of today), while cider
does.
https://github.com/joaotavora/eglot/issues/661
That said, I use eglot
and live with that.
For external definitions, I use clojure.repl/source
or clojure.repl/doc
or even open the source code, since it’s usually a lib from my own company.
Also, maybe there’s a way of assigning higher priority to eglot
’s backend, supposing it’s hooked into xref
. I’m not too familiar with xref
so I don’t know if it’s possible.
I am aware, but cider's xref-find-references only leads me to the top level form, usually a function, that references something. Clojure-lsp and eglot take me directly to the reference.
For external projects, I just use cider-find-var
.
A solution I just came to after reading some cider source was to redefine this function after cider is loaded
(defun cider--xref-backend () nil)
When it always returns nil cider doesn't set any xref stuff, but the other commands cider provides for navigation continue to work. Feels like a hack but I like it better than what I had before.
@UDVJE9RE3 Did you look at https://docs.cider.mx/cider/usage/misc_features.html#xref-integration ?
Wow I feel so dumb. All that searching and I somehow didn't find that. It's exactly what I'm looking for. The xref-fn-depth specifically. Thank you for sending that to me!