clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 646 forks source link

Restarting CLJS repl when using cider-restart #1874

Open leppert opened 7 years ago

leppert commented 7 years ago

cider-jack-in-clojurescript is a great convenience method for booting up a piggiebacked ClojureScript REPL. It'd be handy to have an equally easy way to restart both the primary CLJ and piggiebacked CLJS repls, perhaps by modifying or extending cider-restart.

Does this already exist by chance? Any big barriers to its existence?

bbatsov commented 7 years ago

I think it will be really easy to extend to cider-restart restart both REPLs. The only reason we haven't done is probably because we didn't think about this. I don't do ClojureScript development myself and rarely come up with ideas to improve the ClojureScript support in CIDER.

dpsutton commented 7 years ago

As far as I can tell, this feature is implemented?

(defun cider-restart (&optional restart-all)
  "Restart the currently active CIDER connection.
If RESTART-ALL is t, then restarts all connections."
  (interactive "P")
  (cider-ensure-connected)
  (if restart-all
      (dolist (conn cider-connections)
        (cider--restart-connection conn))
    (cider--restart-connection (cider-current-connection))))

Have you tried this with a prefix?

dpsutton commented 7 years ago

Looks like the clojurescript repl comes back but doesn't "know" to run its invoking stuff: ie, the initial invoking of the cljs repl. also looks like a couple errors pop up at the bottom as well.

bbatsov commented 7 years ago

Seems we need a solution similar to the one tracking the invocation command here https://github.com/clojure-emacs/cider/pull/1905 //cc @cskksc