Hi Clojurians!
I try to use CIDER with two REPLs one for cljs and one for clj
I first start the cljs one with shadow-cljs
and everything is fine
once I start the clj one with lein
I am no longer able to evaluate expressions
a limitation of CIDER when there are two repls open is that the last repl you had highlighted needs to be the one you intend to evaluate in. So if you want to evaluate cljs code, the cljs repl needs to be the last focused repl and not the clj one. Likewise, if you want to evaluate clj code the clojure repl needs to be the last highlighted buffer. By highlighted i mean the buffer had your cursor in it more recently than the other one
let me try
but once the second one gets started, I loose the CIDER menu from emacs
i've never used those menus
me neither
I use them to see the available commands and the keyboard shortcuts
but it is linked to the limitation you mentioned
🙂
thanks it was very helpful
the menus an all features disappear when the wrong repl was highlighted last
I expected CIDER to select the repl based on file type
nevertheless is not big deal if you know about it
i agree. its kind of a complication due to some internal choices at the moment
Hmm, I'm a bit puzzled by this remark:
> a limitation of CIDER when there are two repls open is that the last repl you had highlighted needs to be the one you intend to evaluate in. So if you want to evaluate cljs code, the cljs repl needs to be the last focused repl and not the clj one.
Last time I checked if the two REPLs are the same session the evaluation commands will dispatch the evaluation to right REPL, and if there's just one REPL per session the evaluations should happen there.
https://docs.cider.mx/cider/0.26/usage/managing_connections.html
Normally, the most recent REPL is taken under consideration only for REPLs of the same type in the same session as then you can't easily guess which one to use.
> The current REPL is the most relevant REPL from the current session. REPL relevance is determined by the type of the current buffer. For example if the current buffer is a clj buffer then a clj REPL is selected. Ambiguous situations could arise when, for instance, there are multiple clj REPLs within a session, or the current buffer is a cljc buffer and both clj and cljs REPLs exist in the session. In such cases the current REPL is the most recently viewed REPL of the relevant type. That's from the docs.
> but once the second one gets started, I loose the CIDER menu from emacs That's weird and it should be happening. Can you please file a ticket with the exact steps you're taking to start the two REPLs so I can check what's going on when I can.