tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Allow direct cljs nREPL connections #420

Open chr15m opened 2 months ago

chr15m commented 2 months ago

First, thank you so much for Fireplace and your years of work on Vim plugins! :pray:

There are now runtime environments that are pure ClojureScript running on e.g. Node and they have no Clojure/JVM or Piggieback in sight. For example nbb is cljs on Node and provides a basic nREPL (there are others). Some other nREPL clients are able to connect to and use this as documented in that link. Not all features are supported but you can at least send code and have it run.

To stand up an nbb nREPL:

mkdir nbb-nrepl-test; cd nbb-nrepl-test
echo {} > package.json
npm i nbb
npx nbb nrepl-server :port 1337

In Fireplace after running gvim test.cljs I can connect to this with :Connect 127.0.0.1:1337 and I can do :CljEval and it works, as I guess Fireplace assumes it's a regular Clojure nREPL. However when I do cqq on a form I get:

Fireplace: no default ClojureScript REPL

Is there a way for me to tell Fireplace that the current REPL connection it has open is already a ClojureScript REPL? If not, any tips or pointers for adding thise so I can raise a PR are much appreciated! Many thanks!

Updated to add: here is a thread where they work out the same issue in CIDER on Emacs: https://github.com/clojure-emacs/cider/issues/3061