CIDER doesn't really check anything in the user configs and optimistically injects everything that's needed. The assumption was always that if someone tweaked their project config for some particular reason they probably know how to tweak CIDER's config as well.
KISS 🙂
That’s what Calva does too. Which brings me back to the question if I am wrong to expect to see the middleware injected? Calva adds this to the command line:
-- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]'
CIDER doesn’t, on my colleagues machine. So he has to add it to his global lein config or in the project. I can live with it added to the project, but I’d prefer not to have it there and rely on injection by the editors.I just tested this locally and the Piggieback injection works fine.
That's the CIDER command line invocation - /home/bozhidar/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\] -- repl :headless :host localhost
(for Lein at least)
I have to check if it's some problem with tools.deps.
For leiningen the middlewares get the added by the Lein plugin, as it's a bit simpler this way.
Not sure why decided to do this differently.
> For leiningen the middlewares get the added by the Lein plugin, as it’s a bit simpler this way.
So, the -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\]
takes care of it?
The full Calva comand line in our project looks like so:
lein update-in :dependencies conj '[nrepl,"0.8.3"]' -- update-in :dependencies conj '[clj-kondo,"2020.04.05"]' -- update-in :dependencies conj '[cider/piggieback,"0.5.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.25.6"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]' -- with-profile +test,+dev,+script repl :headless
Maybe it is overkill, but it works. 😃 With CIDER we got some intermittent piggieback complaints, and I started to suspect that missing middleware injection, but then it is probably something else causing the friction.Curious, why doesn't WARNING: When invoking clojure.main, use -M
show up in the *Messages*
buffer when doing cider-jack-in
?
it probably shows up in the nrepl buffer. output from the process doesn't really go in messages
oh ok
we need to migrate CIDER to use the -M
version and let people upgrade
-M -m
i mean
there's a ticket i need to do with aliases and mains as well. probably do both PRs at the same time
Cool, guess it harmless for now
yeah. its just a warning
is this the issue? https://github.com/clojure-emacs/cider/issues/2941
and not a warning about the program is in an unknown state but just its changing and won't support it in the future but its fine for now
yeah that's the one. you interested in working on it?
i think it won't be bad at all. just a bit of string editing
i'm happy to help with questions. and in fact i think its so simple that i could do it independently so i make sure to think of all the possible pitfalls and help you through you landing the PR if you like
more contributors = better CIDER
I could take a look, my emacs foo is very limited at this stage but I'll take you on the 'help with questions' 😉
totally. feel free to ping me here. there's also a discord server that you could join. its kinda more geared towards dev stuff so this would be perfect for you to ask questions there too
There needs to be some clojure
cli tool version detection I guess? to not break old versions
like -M -m
won't work with older versions
there's no good way to do it. you'd have to grep the version out of a bunch of stuff. i imagine we just go towards the most current behavior and ask people update
ok
yeah. but that's kinda inevitable. CIDER can't work with lein 2.7.3. you're kinda expected to upgrade. And the clojure cli tools are developed by Alex so changes are thoughtful and no backwards breaking changing (in theory. there have been some but Alex is awesome and thoughtful and this isn't a big problem at all)
fair