Disable saving when sending command to repl

31 views
Skip to first unread message

Tom Locke

unread,
Apr 18, 2019, 4:23:08 AM4/18/19
to Cursive
Is there a way to prevent Cursive from saving changes to my files whenever I execute a REPL command?

I think there was some discussion about this in the past - a preference option somewhere that Cursive was ignoring - but I can’t find it now.

This seems like a small thing but it actually causes huge problems with my cljs development flow, because it triggers a recompile, which then triggers my dev-reload hook. 

Thanks

Tom

Tom

unread,
Apr 22, 2019, 9:54:48 AM4/22/19
to Cursive
Failing this, would it be possible to have shadow-cljs *not* watch for changes to files, and instead use a RELP command from Cursive to tell shadow-cljs to compile? I've tried running the shadow-cljs server but not the watch process, but the REPL then doesn't work.

Thanks

Tom

Thomas Heller

unread,
Apr 22, 2019, 2:25:04 PM4/22/19
to Cursive
This is supported yes. It currently requires launching the watch process from the REPL though.

So you start "shadow-cljs server" normally and then connect to the provided nREPL server, use the embedded variant or "shadow-cljs clj-repl"

  (shadow.cljs.devtools.api/watch :the-build {:autobuild false})

This will launch the watch "worker" that handles all the REPL related stuff but without actually triggering recompiles on file change.

Then you can use the REPL normally and if you wish to trigger a normal recompile you can do so by calling

  (shadow.cljs.devtools.api/watch-compile-all!)

or

  (shadow.cljs.devtools.api/watch-compile! :the-build)


You can bind these to a REPL command in Cursive.

This needs to be triggered from the CLJ REPL though. It cannot currently be triggered when in the CLJS REPL.

HTH
/thomas

Tom

unread,
Apr 26, 2019, 6:22:12 AM4/26/19
to Cursive
Thanks for the help. This sounds like just what I need.

It could be a pain having to switch back and forth between the CLJ and CLJS REPLs though.

As far as I know we don't yet have a way to tell Cursive that a given REPL command should be sent to CLJ/CLJS as appropriate, right Colin?

Colin Fleming

unread,
May 2, 2019, 6:04:08 AM5/2/19
to Cursive Group
Hi Tom,

My apologies for the delayed response here - no, currently there's no way to do this automatically. It's Coming Soon©, but has been for ages now, sorry.

Going back to your original question, it actually might be a good idea to have a checkbox (enabled by default) per REPL command to control whether everything is saved or not. I think having it save as the default behaviour makes sense, but there are some specialised use cases where I can imagine it causing problems.

Cheers,
Colin
--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages