This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-15
Channels
- # announcements (9)
- # babashka (1)
- # beginners (1)
- # calva (7)
- # cider (13)
- # clj-kondo (2)
- # cljsrn (1)
- # clojure (40)
- # clojure-europe (2)
- # clojure-spec (9)
- # clojure-uk (1)
- # cursive (4)
- # datomic (2)
- # etaoin (1)
- # fulcro (4)
- # honeysql (3)
- # lsp (43)
- # malli (7)
- # music (1)
- # nbb (6)
- # off-topic (5)
- # polylith (8)
- # protojure (1)
- # re-frame (6)
- # react (17)
- # reagent (63)
- # releases (1)
- # shadow-cljs (8)
- # testing (8)
- # tools-deps (1)
- # vim (8)
Programmatically via
(nrepl-server/start-server :port port)
@nicdaoraf Are you sure that nrepl-server has the cider-nrepl middleware in it? They're different concepts, have to be composed together. See https://github.com/clojure-emacs/cider-nrepl/blob/6d3934eb665574af891e81ef5c11cf9c2b4e1d65/src/cider/nrepl.clj#L548
Is it enough to have
:plugins [[refactor-nrepl "2.5.1"]
[cider/cider-nrepl "0.25.5"]]
in my project.clj
?client-side yes, server-side they have to be :dependencies and you have to add the middleware by hand (...given that you're building a server programatically. Lein plugins don't go as far as mutating the code you write)
Hmm, what do you mean by client side?
My local emacs that's connected (via cider-connect
) to the remote nREPL server?
yes Emacs injects those :plugins for you if not present, so they're optional (but you'd need them explicitly if connecting from the terminal)
How does Emacs inject these :plugins
if they're not present? As part of cider-connect
?
ahh I said something partly incorrect, it's cider-jack-in
the one command that injects :plugins
long story short, if you intend to build a nrepl -server programatically, make sure to pass a custom :handler
to it, namely (refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-nrepl-handler)
and cider-connect (the client side) doesn't need a :plugin whatsoever
It should work. I use such a setup every day, here's the (very contrived) code if that helps at all https://github.com/reducecombine/.lein/blob/e05d6a2d22c0990a88a660c25fe8c5e51a3c6b1a/scripts/vemv/nrepl.clj#L46-L66
Yes that somewhat helps ๐