Nbb, scittle, joyride: On latest cider, you can now do cider-connect and it should just work. No need anymore for the workaround snippet! There will also soon be a cider jack in command for nbb.
Hi! Thanks for working on this
I'm having a problem with cider-connect and cider-connect-clj: they work fine with my evaluation target when I'm in a buffer for a file with a clj suffix, but tell me I have no connected REPL when it's a cljs file/buffer. This led me to suspect I needed to use cider-connect-cljs , but I get the same behavior there! The *cider-repl* buffer works fine, but in-buffer evaluation fails. Am I holding it wrong?
i'm not sure what connect-cljs will do. But connect-clj should work
It works great in clj files
cider-connect and cider-connect-clj are the same function. cider-connect was the old name, when nothing but Clojure existed and life was simple. 🙂
Assuming you're talking about nbb, I'll have to check more carefully if it can be used directly, as I was mostly focused on getting cider-jack-in-cljs to work properly with nbb (but it does use cider-connect-cljs to establish the actual connection).
Might be good to just file a ticket, as I tend to forget problems that got reported in the chat.
My evaluation target is an embedded browser with sci baked in, so if we can get it to do the right thing with nbb, it should also work for me.
Benjamin made cider-connect-clj work with all sorts of REPLs, but generally for ClojureScript stuff it's good to have the cljs commands work as well, as the REPL types are handy if you have multiple REPLs in the same CIDER session.
if you cider-connect (clj) and your repl handles evaling cljs.core/demunge it will assume it handles cljs. Guess cider-connect-cljs is supposed to work I'll check
> My evaluation target is an embedded browser with sci baked in, so if we can get it to do the right thing with nbb, it should also work for me.
Probably you'll need to set at least some mapping of the upgrade forms for sci, as now cider-connect-cljs can be instructed not to try to "upgrade" connections, which was the original problem (it assumed all connections were hosted).
There's an entry for nbb, that I'll post here now.
See https://github.com/clojure-emacs/cider/blob/master/cider.el#L1028
Seems to me we likely need to add a SCI ClojureScript REPL type, that you can select when connecting and we'll be in business.
Also, to make the cider-connect-clj work, there might be a more complete check than cljs.core/demunge
Alternatively I suspect cider-connect-cljs -> nbb will work right now. Because that makes it a cljs repl without a setup form.
I don't have an nbb option in cider 1.6, but I agree with a general sci catchall that doesn't expect to be able to eval any particular form
maybe you pulled cider but didn't load cider.el? Because 1.6 should have a nbb entry (thats the code that bozhidar posted)
Yeah, I just checked the code again and the entry's everywhere it's supposed to be.
I used the interactive package management in emacs to upgrade. cider-version reported 1.6.0, but no nbb option. Re-starting emacs gets me the nbb option, which now works with an nbb REPL but still fails for mine. I'll try to debug the differences between NBB's REPL and mine on this end.
maybe you have another idea except checking cljs.core/demunge to check if cljs is available.
Would either of you know off-hand what kind of failure would result in the REPL connecting properly and working fine, but the cljs buffer from which cider-connect was invoked not activating cider-mode? There's quite a bit of indirection and hooking/callback'ing around that process that makes it somewhat painful to track down in the debugger.
I would put message forms around
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
in line 367 of cider-connection.el.
cider-auto-mode is not nil? I'm guessing another failuremode is an error in that lambda starting at line 341 (cider-repl-init ... ). So that (cider-enable-on-existing-clojure-buffers) never happens.btw is there a way to try the repl myself?
Thanks, I'll take a look around there tomorrow. No public release yet, mostly because the only editor that Just Worked(tm) with an arbitrary evaluation target when I built it was Conjure.
Related PR: https://github.com/clojure-emacs/cider/pull/3272 Thanks @benjamin.schwerdtner for the above PR, @mkvlr for sponsoring the work and @chaos for working on the bespoke nbb command.
@chaos has joined the channel
@cfleming has joined the channel
@jackrusher has joined the channel