Fork me on GitHub
#cider
<
2016-05-17
>
twashing01:05:08

Is there a way to make cider-connect auto inject dependencies, the same way cider-jack-in does? https://github.com/clojure-emacs/cider/blob/master/cider.el#L512

twashing01:05:15

I tried setting cider-jack-in-auto-inject-clojure, but to no avail. https://github.com/clojure-emacs/cider/blob/master/cider.el#L245

twashing02:05:30

@malabarba I’m just playing around with some of the functions. And this:

twashing02:05:36

(cider-inject-jack-in-dependencies
 (cider-jack-in-params "lein")
 "lein")

twashing02:05:40

gives me this:

twashing02:05:45

"update-in :dependencies conj \\[org.clojure/clojure\\ \\\"1.8.0\\\"\\] -- update-in :dependencies conj \\[org.clojure/tools.nrepl\\ \\\"0.2.12\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.3.0-SNAPSHOT\\\"\\] -- update-in :plugins conj \\[cider/cider\
-nrepl\\ \\\"0.13.0-SNAPSHOT\\\"\\] -- repl :headless"

twashing02:05:04

Why can’t we inject cider deps on connect?

twashing02:05:20

So on startup we’re executing lein update-in :dependencies conj \\[org.clojure/clojure\\ \\\"1.8.0\\\"\\] -- update-in ... -- repl :headless

twashing02:05:40

Wondering if can’t just inject those deps into a running repl, like how pomegranate does.

malabarba02:05:00

You can inject dependencies with a bit of work

malabarba02:05:27

But I don't know if you can inject midddleware after the repl had started

malabarba02:05:14

It's probably possible to implement. I just meant you can't do it right now with cider simple_smile

malabarba02:05:28

PRs welcome, though 😉

twashing02:05:33

Right right

twashing02:05:39

Indeed, lol.

twashing02:05:01

Well, from what I can tell, we have:

update-in :dependencies conj [org.clojure/clojure "1.8.0"] 
update-in :dependencies conj [org.clojure/tools.nrepl "0.2.12"] 
update-in :plugins conj [refactor-nrepl "2.3.0-SNAPSHOT"] 
update-in :plugins conj [cider/cider-nrepl "0.13.0-SNAPSHOT"]

twashing02:05:16

Is the middleware refactor-nrepl and cider-nrepl ?

malabarba03:05:41

@twashing sort of. Those are actually lein plugins (sort of dependencies). But they do contain the midddleware that is injected, yes.

twashing03:05:58

@malabarba Yeah, I’m crawling through tools.nrepl middleware docs right now: https://github.com/clojure/tools.nrepl#middleware

twashing03:05:41

… and while there’s no indication that middleware can be injected after the fact.

twashing03:05:33

the whole concept of middlewares in this case (decorating requests before being sent to the server), exists entirely on the client’s side.

twashing03:05:54

So yeah, I’d have to play around with it a bit more.

twashing03:05:12

Thanks for the feedback 👍:skin-tone-5:

malabarba03:05:08

I'm not sure I understand you. Nrepl middlewares go on the server.

fenton19:05:53

i want to cider-connect to an nrepl server... however, when i do, my cider functions dont seem connected to that REPL. is there an emacs variable or something that needs to be set like cider-cljs-lein-repl. i dont want to jack-in

plexus19:05:55

@fenton: cider consist of a part in emacs and a part in Clojure. The project you're connecting to needs to have the Clojure part loaded. Either add cider as a dev dependency in your project.clj, or inject it on the command line when starting lein repl

fenton19:05:05

@plexus: key lemme try.

plexus19:05:05

Try cider-jack-in and have a look at your *messages* buffer, then you can see the invocation of lein repl that cider uses to inject itself

fenton19:05:17

ahh, good idea...

malabarba19:05:33

The easiest way to get the cider midddleware in a repl that you start separately is to add it as a lein plugins

malabarba19:05:45

There's a recipe in the manual

malabarba19:05:10

But copying the jack in command should work too

fenton19:05:12

@malabarba gonna go look at manual...

mikerod20:05:10

If I do cider-connect and have orphaned buffers, it prompts me if I want to use them. If I say yes, it ask which one, but always says "no match"

mikerod20:05:39

There is no tab completion, and I cannot type the name into the minibuffer because when I hit a <space> it tries to find it and fails

mikerod20:05:48

so I cannot manually type the whole buffer name, and I have no autocomplete

mikerod20:05:53

not sure how to search for this one online

mikerod20:05:34

0.12.0 cider with the same cider-nrepl version and 5.3.0 clojure-mode version

iku00088823:05:42

@mikerod: I had a completely unrelated weirdness with 0.12 version of cider and upgrading it to the snapshot version somehow fixed it. If everything else fails, maybe that is an option.