Fork me on GitHub

Is there a shortcut for toggle CLJ/CLJS REPL


the button is too small, hard to click.


@doglooksgood No, but generally it switches itself when it needs to.


Note that that toggle doesn’t affect the state of the REPL at all, i.e. it does not switch the REPL from clj to cljs


It’s there because cljs REPLs are often layered over clj ones. So when you run your cljs REPL inside a clj REPL, Cursive had no way to know when that had happened.


It now tries to detect that case by looking for known output strings, but it’s not perfect.


If I use figwheel, I should start figwheel, then type (cljs-repl) in REPL, and It switches to cljs. What should I do if I want to type some clojure code, quit cljs by :cljs/quit?


Right now, yes, or you could start another clj REPL - you can have multiple REPLs open in tabs.


I’m working on a combined clj/cljs REPL but there isn’t one yet.


It seems that when cljs REPL start, the clj REPL is still there. so maybe: when the cljs REPL connected, cursive should make another connect to that nREPL?


Yes, that’s what I’m planning, but it’s hard to do automatically without having an integrated REPL solution. For example, many cljs projects don’t use nREPL.


But you can do that by starting Figwheel in one REPL, and then connecting another REPL to its nREPL server using a Remote REPL run config.


If I understand correctly, this button here now is a indicator instead of a switcher


@doglooksgood Well, sort of. Cursive does use its state - how completion works in the REPL depends on that switch, because CLJS completion is different to clj completion. Cursive will also prevent you from loading Clojure code into a CLJS REPL.


However Cursive does try to switch it, so it’s like an indicator of what Cursive thinks your REPL is doing (which does affect behaviour) which you can fix if it gets it wrong.


thanks for explaining in detail!


No problem! It would be even better if I documented it 🙂


@cfleming Re: breaking - no I haven’t set any breakpoints myself. I’ve set “Break on all exceptions”, but I actually want “Break on all uncaught exceptions", regarding my example snippet


Is there a way to get the full stacktrace when using "Print last exception" command?


Is disabling of locals clearing known to work? In my experience, with the debugger, I still see locals getting cleared all the time, regardless of the setting of the button.


FYI: IntelliJ IDEA 2016.3.4and Clojure 1.9-alpha-14.

Alex Miller (Clojure team)18:02:38

from a compiler perspective, it works afaik

Alex Miller (Clojure team)18:02:05

and I do see locals when I use Cursive debugger


I’m glad it works for someone! I wonder what’s going on in my environment?


@hlship plugin conflict? I had some weird interactions between Cursive and the Elixir plugin a while back. It was early versions, and hasn’t been a problem for the last several releases, but for a while I couldn’t use Cursive if the Elixir plugin was there.


Hard to say, but I’m not using many plugins. I’m watching what’s going on, when it works and when it doesn’t. May be related to reloading code.