acid.nvim icon indicating copy to clipboard operation
acid.nvim copied to clipboard

ClojureScript support

Open devth opened this issue 7 years ago • 5 comments

Thoughts on supporting CLJS?

devth avatar Mar 27 '17 12:03 devth

I've never actually worked with CLJS, but I'd like to add support. Not really sure about how to do that, though.

I'll take a look at piggieback to understand some more about it.

This will probably be the next major bump.

hkupty avatar Mar 27 '17 14:03 hkupty

Pseudo-code of python written in Clojure

(defn get-session
  [path]
  (if (string/ends-with? path ".cljs")
    (:cljs-session @state)
    (:session @state)))

To initialize the cljs session, you clone the current session (and get a new id), and call a user-supplied repl-env function. The one provided by boot-cljs-repl is the most stable in my experience. This will turn the new session into a cljs session.

SevereOverfl0w avatar Apr 02 '17 09:04 SevereOverfl0w

Some thoughts coming from working with .cljc files with fireplace.vim: fireplace only lets you connect to a single nrepl (either piggieback-or-similar for CLJS or a normal CLJ nrepl). When working with .cljc files it'd be very useful to be connected to both, and allow requires or any other sort of evals to target either CLJ or CLJS repls.

Not sure what the UX would be like. Separate mappings for CLJ and CLJS? Or some way to toggle which repl to target?

devth avatar Jul 13 '17 17:07 devth

It seems that some sort of session management is needed.. I've drafted a bit of this and a rudimentary implementation of 'sticky session' exists, while untested.

As soon as I have enough time to play with this, I'll come up with a long-lived branch that implements this behavior and make it available here for testing.

hkupty avatar Jul 14 '17 17:07 hkupty

I've recently added sessions to the new lua version. I believe there might be still a few bits until full cljs support out of the box, but it should be possible already.

Does anyone mind guiding me to test this?

hkupty avatar Apr 12 '19 15:04 hkupty