This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-16
Channels
- # atlanta-clojurians (1)
- # aws (1)
- # beginners (65)
- # boot (4)
- # cider (81)
- # cljs-dev (25)
- # cljsrn (27)
- # clojure (129)
- # clojure-dusseldorf (12)
- # clojure-italy (68)
- # clojure-norway (5)
- # clojure-poland (4)
- # clojure-spec (14)
- # clojure-uk (72)
- # clojurescript (144)
- # code-reviews (19)
- # copenhagen-clojurians (5)
- # cursive (16)
- # datomic (21)
- # editors (1)
- # emacs (15)
- # events (1)
- # figwheel (6)
- # fulcro (54)
- # graphql (1)
- # hoplon (24)
- # jobs (6)
- # jobs-discuss (2)
- # keechma (4)
- # leiningen (6)
- # luminus (17)
- # lumo (2)
- # off-topic (43)
- # onyx (6)
- # pedestal (2)
- # perun (2)
- # portkey (3)
- # re-frame (22)
- # reagent (11)
- # ring-swagger (5)
- # shadow-cljs (46)
- # specter (8)
- # test-check (2)
- # testing (3)
- # vim (16)
- # yada (1)
What does this mean? > CIDER can also inject a Clojure dependency into your project From https://cider.readthedocs.io/en/latest/installation/#ciders-nrepl-middleware What does it mean for Cider to inject a clojure dep into my project? Like, the cider client sends the running process code to use via the repl socket?
I'm honestly not sure what you've tried. Are there simple steps that I could try to reproduce?
Cider uses clojure code to do its thing. To do this it needs its dependencies which it injects at Jack in or else you provide manually
@dpsutton Well the problem is that i can’t get cider to connect to a repl that works e.g evals expressions, finds the deps specified in deps.edn via :local/root
here is the project: https://github.com/drewverlee/try-boot
1) run clj -A:nrepl
2) from emacs run cider-connect
I get no port to connect to.
If i just run cider-jack-in
i get a huge stack trace error that i’m not even sure how to copy paste because it appears in a window and this disappears 😞
I'm not sure how polished or even implemented deps edn support is to be honest though
Also don't know if you need to provide cider nrepl and orchard dep as well. I know we don't merge that profile into the deps so I imagine you need to provide ciders requirements
what is orchard dep?
@drewverlee You can see exactly what’s the command line string that CIDER uses to start an nREPL server after invoking cider-jack-in
. Nothing really special - it just adds a few deps, so you don’t have to add them to your projects.
Here’s a bit of explanations about orchard - https://github.com/clojure-emacs/cider-nrepl#reusable-core-logic
So it seems that cider-jack-in, as far as i can tell, calls this:
/usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'
which throws an exception … [let me find the actual exception]
rting nREPL server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate refactor_nrepl/middleware__init.class or refactor_nrepl/middleware.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
I see where cider is invoking this function: https://github.com/clojure-emacs/cider/blob/18a5f10021a70134310f367547c4c750e1acedba/cider.el#L529
But i’m not sure where all the deps come from, which would be useful because maybe i can adjust some of these deps. Sayid strikes me as a odd dep to include by default, so i assume thats coming from configuration i added but i can’t tell where.I think there's a bug where dependencies aren't added, not sure what the status of that was though. I noted it a little while ago.
does running clj -sDeps
add to the existing deps files? Other wise i’m confused about how cider running that command would achieve the desired effect as it wouldn’t pick up the deps needed for the project. Clearly it does work, so i have a misconception somewhere.
You certainly don’t need sayid
or refactor-nrepl
to be using CIDER. That’s certainly not coming from CIDER - likely you’ve got clj-refactor.el
installed and its injecting those.
@bozhidar Can you help me understand where i can look to see if its installed?
Asking because i can’t seem to track down where this could come from: my spacemacs config file doesn’t mention it. I dont think its in my emacs folder and i’m not sure how to search emacs for it.
@drewverlee is having issues with the command generated by cider when refactor-nrepl
is around. As I’m not familair with him setup I’m puzzled by what’s going on there - seems he’s getting some extra deps added and clj
is blowing up.
@drewverlee You can use package-list-packages
to see what’s installed. If you’re using Spacemacs I guess you can take a look at its Clojure layer or whatever.
Look at the CLI, refactor-nrepl and sayid are not being injected as a dependency, only as middleware
The problem is that the “real” integration relies on a lein-specific variable (namely plugins).
I’ve addressed @dominicm’s feedback actually (it was about the middleware stack), but as far as the deps go - it’s a bit of a mess.
i tried out the latest [cider/cider-nrepl "0.17.0-SNAPSHOT"]
@bozhidar - when i cider-connect
to a terminal app i'm now getting logging both on the terminal and in my cider-nrepl buffer. is it possible to stop the logging to the cider-nrepl buffer entirely, leaving only the terminal logging (i find logging to the emacs buffer mostly just obfuscates my repl session) ?
It’s tricky currently - that’s why I wanted to make this configurable, but didn’t have time for it.
@benedek I see the deps are dynamic, but I’ve hardcoded cider’s middleware as normally it comes from the odd lein plugin variable. Could it be that clj-refactor.el is actually updating it?
OK, then I know how to fix this, but it seems to me we should change this to be have a separate notion of deps and lein plugins, as this is just confusing on boot, clj, etc.
We’ve got two vars - jack-in-deps and jack-in-plugins. Seems all extensions are adding their middleware deps to the plugins var, which is currently ignore by some of the code (I thought this was lein specific).
I can fix this temporary by merging the plugins with the deps for clj, but I definitely think we should do something different and consider those plugins only for lein. Unfortunately this would mean we have to subtract the plugins from the deps for lein, but I guess that’s not a big deal.
This is the data shape I came up with: https://github.com/clojure-vim/vim-jack-in/blob/master/plugin/jack_in.vim#L9-L16
lein
:: Needs special plugin
boot
:: Explodes sequences and assumes they are all middleware
clj
/`cider.main`:: Same as boot
I like the idea actually! That way we can stuff everything in the same list and just transform it accordingly for different tools.
My only maybe regret is that 'version'
doesn't support tools.deps.alpha style dependencies, so git dependencies don't work. Hasn't been a problem so far, but I could see it eventually coming up.
@dominicm Everything looks good. The failures seem like some Travis issue, I’ll rerun the build.
Just checking in on this, is there anything I can do help? Is there a ticket open somewhere where i can follow the changes? In case its not clear, i’m asking about the cider deps/clj integration. I get the impression everything isn’t wired up yet. Which is cool as i might be able to help. I assume this is a fairly request feature?
I’m gonna try to get to fixing my cider-nrepl changeset tonight. Sorry this has been so slow.
I really wanna rewrite the cider-repl.el to use separate markers for every REPL session. Right now all output gets interleaved in the most current eval result’s space.
@drewverlee Just committed a fix for this.
@arrdem But how can we separate this? The output goes to whatever has been determined to be the current connection/repl.
@bozhidar it may not make sense - I think about CIDER as a code execution server, not a straight REPL. It’d be interesting to track nREPL request / response IDs and try to maintain a mapping from nREPL requests to “windows” in the buffer where results (output, print, etc.) go.
Rather than just maintaining one “end of buffer” to insert to which is what happens now.
The main effect would be that printing from threads would go to “old” eval “windows” not the current one