This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-09
Channels
- # aleph (1)
- # asami (5)
- # babashka (4)
- # beginners (8)
- # biff (19)
- # calva (2)
- # cider (14)
- # clojure (17)
- # clojure-dev (3)
- # clojure-europe (3)
- # clojurescript (2)
- # community-development (9)
- # conjure (1)
- # core-typed (2)
- # datomic (6)
- # emacs (20)
- # gratitude (1)
- # helix (5)
- # kaocha (4)
- # nbb (1)
- # releases (3)
- # testing (17)
has anyone gotten eglot and cider to play nice? I find that when I use them together, xref-find-references
doesn't work and it shows both the LSP args/docstring and the Cider args/docstring.
I assume that eglot has similar crossover with cider that lsp-mode has, so where the same features are provides they should be disabled in either cider or LSP E.g https://manueluberti.eu/2023/03/25/clojure-lsp.html I would be interested in trying eglot (I'm running Emacs 29) so anythng you can share on getting eglt and cider to be happy is much appreciated
I do.
So for XREF I have this in my cider config and I use only Eglot for that (I haven’t found any advantage of using Cider for it).
(setq cider-use-xref nil)
And I have also this custom code
(defun my/remove-eglot-documentation-functions ()
(interactive)
(when (and (bound-and-true-p cider-mode) (cider-connected-p))
(remove-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function t)
(remove-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function t)
(remove-hook 'eldoc-documentation-functions #'eglot-completion-at-point t)
(setq completion-at-point-functions (remove 'eglot-completion-at-point completion-at-point-functions))))
which runs by this hook
hook ((cider-connected . my/remove-eglot-documentation-functions))
That’s because I’m not able to get as much documentation with Eglot as with Cider. But sometimes i want to edit CLJ without running REPL.
My pop-up in Corfu (alternative to Company) doesn’t work with Eglot and I also don’t have documentation in minibuffer. So this is handled by Cider only once it starts..
I think this is exactly what I want @UBRV1HXPD 😄 sounds like we have similar configs
Let me know if you can configure Eglot to show CLJ documentation somewhere 😅. I was able to do this partially if I had yasnippets enabled, but I honestly never got to grips with snippets in clojure, so I have them disabled now...
I can’t even imagine running both at the same time. How’s the resource usage and responsiveness of emacs?
I like to run eglot for cljs and cider for clj (though ideally I'd pick and choose specific eglot features in clj, too) and haven't noticed any perf issues. I know LSP can be a big of a hog, but CIDER shouldn't be, right?
@U061KMSM7 To be honest, the only performance issue I have got with Emacs is when Cider has to process some long output. When I got invalid malli schema for > 1000 entities (every with 20 keys) I can wait several minutes to get complete output… But yeah, Eglot is more lightweight than lsp-mode. @U05092LD5 Me too. This is why my config disables Eglot features only when I am connected to REPL.
Has there been any update to this? I am trying Emacs 30 with eglot
today and xref-find-references
still does not work out of the box, if it still does not I'll revert back to using LSP mode
cider's xref integration works. I use it daily.
IDK anything about eglot. Use M-x xref-find-references
/ M-x xref-find-definitions
to try xref directly.
If you use xref - there may be N competing backends. M-: xref-backend-functions
shows them all.
CIDER's xref is not the best thing ever (only works for JVM clojure, and misses some corner cases) so it would seem perfectly fine to mix and match cider / clojure-lsp
Hope it helps!
M-x xref-backend-functions
returns (lsp--xref-backend t)
when I'm using lsp-mode and CIDER and that works fine.
I thought I could use what's built in to Emacs for LSP capabilities but that seems to not be possible at the moment.
With eglot and CIDER it returns (cider--xref-backend eglot-xref-backend t)
, there's something to investigate there perhaps.
CIDER doesn't participate in the LSP protocol in any way, so an eglot<->cider integration seems unlikely to work (Especially) If you removed eglot-xref-backend from the backends list, I'd expect xref-find-references to work with cider