Fork me on GitHub
#cider
<
2021-08-15
>
anonimitoraf03:08:14

Programmatically via

(nrepl-server/start-server :port port)

vemv03:08:54

@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

anonimitoraf03:08:18

Is it enough to have

:plugins [[refactor-nrepl "2.5.1"]
          [cider/cider-nrepl "0.25.5"]]
in my project.clj?

vemv03:08:34

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)

anonimitoraf03:08:22

Hmm, what do you mean by client side? My local emacs that's connected (via cider-connect ) to the remote nREPL server?

vemv03:08:32

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)

anonimitoraf03:08:09

How does Emacs inject these :plugins if they're not present? As part of cider-connect?

vemv03:08:02

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

anonimitoraf03:08:58

Ooooh, I'll try that out now, thanks

๐Ÿป 3
vemv04:08:18

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

anonimitoraf04:08:22

Yes that somewhat helps ๐Ÿ˜„

anonimitoraf04:08:58

Cool, it works ๐Ÿ˜„. Thanks heaps

๐Ÿป 3
๐Ÿš€ 3
anonimitoraf03:08:28

I'll reply on a thread ๐Ÿ™‚

๐Ÿงต 3