Fork me on GitHub
#cursive
<
2017-02-10
>
tianshu02:02:30

Is there a shortcut for toggle CLJ/CLJS REPL

tianshu02:02:42

the button is too small, hard to click.

cfleming02:02:15

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

cfleming02:02:47

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

cfleming02:02:30

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.

cfleming02:02:49

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

tianshu02:02:28

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?

cfleming02:02:04

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

cfleming02:02:14

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

tianshu02:02:51

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?

cfleming02:02:23

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.

cfleming02:02:52

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.

tianshu02:02:17

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

cfleming03:02:56

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

cfleming03:02:39

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.

tianshu03:02:28

thanks for explaining in detail!

cfleming03:02:14

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

grav07:02:39

@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

rauh15:02:45

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

hlship18:02:18

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.

hlship18:02:00

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

hlship18:02:19

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

manutter5118:02:32

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

hlship19:02:11

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.