Fork me on GitHub
#cider
<
2020-12-12
>
Adrian06:12:06

Hi Clojurians!

Adrian06:12:46

I try to use CIDER with two REPLs one for cljs and one for clj

Adrian06:12:52

I first start the cljs one with shadow-cljs

Adrian06:12:11

and everything is fine

Adrian06:12:08

once I start the clj one with lein I am no longer able to evaluate expressions

dpsutton06:12:25

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

Adrian06:12:05

let me try

Adrian06:12:50

but once the second one gets started, I loose the CIDER menu from emacs

dpsutton07:12:07

i've never used those menus

Adrian07:12:03

me neither

Adrian07:12:28

I use them to see the available commands and the keyboard shortcuts

Adrian07:12:44

but it is linked to the limitation you mentioned

Adrian07:12:12

thanks it was very helpful

Adrian07:12:38

the menus an all features disappear when the wrong repl was highlighted last

Adrian07:12:00

I expected CIDER to select the repl based on file type

Adrian07:12:35

nevertheless is not big deal if you know about it

dpsutton07:12:28

i agree. its kind of a complication due to some internal choices at the moment

bozhidar09:12:27

Hmm, I'm a bit puzzled by this remark:

bozhidar09:12:39

> 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.

bozhidar09:12:36

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.

bozhidar09:12:07

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.

bozhidar09:12:23

> 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.

bozhidar09:12:42

> 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.