dev-tooling

Benjamin 2022-12-03T13:06:45.372929Z

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.

🙌 2
2022-12-29T09:01:11.564849Z

Hi! Thanks for working on this

2022-12-29T09:03:59.395809Z

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?

2022-12-29T09:04:24.864089Z

@bozhidar @benjamin.schwerdtner 🙂

Benjamin 2022-12-29T09:04:53.384229Z

i'm not sure what connect-cljs will do. But connect-clj should work

2022-12-29T09:05:18.153129Z

It works great in clj files

bozhidar 2022-12-29T09:05:45.543339Z

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. 🙂

👍 1
bozhidar 2022-12-29T09:08:24.329159Z

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).

bozhidar 2022-12-29T09:08:51.636759Z

Might be good to just file a ticket, as I tend to forget problems that got reported in the chat.

👍 1
2022-12-29T09:09:56.236729Z

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.

bozhidar 2022-12-29T09:10:14.359349Z

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.

Benjamin 2022-12-29T09:10:23.200969Z

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

bozhidar 2022-12-29T09:11:24.062439Z

> 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).

bozhidar 2022-12-29T09:11:38.150159Z

There's an entry for nbb, that I'll post here now.

bozhidar 2022-12-29T09:14:20.771159Z

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.

Benjamin 2022-12-29T09:16:28.971329Z

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.

2022-12-29T09:25:27.256919Z

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

Benjamin 2022-12-29T09:28:24.765019Z

maybe you pulled cider but didn't load cider.el? Because 1.6 should have a nbb entry (thats the code that bozhidar posted)

bozhidar 2022-12-29T09:28:45.414439Z

Yeah, I just checked the code again and the entry's everywhere it's supposed to be.

2022-12-29T09:49:06.442159Z

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.

Benjamin 2022-12-29T10:00:54.517629Z

maybe you have another idea except checking cljs.core/demunge to check if cljs is available.

2022-12-29T15:31:33.076479Z

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.

Benjamin 2022-12-29T16:21:38.825519Z

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.

🙏 1
Benjamin 2022-12-29T17:23:24.645809Z

btw is there a way to try the repl myself?

2022-12-29T19:19:15.404309Z

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.

borkdude 2022-12-03T13:09:05.264609Z

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.

👍 1
🚀 3
chaos 2022-12-03T13:09:08.120809Z

@chaos has joined the channel

cfleming 2022-12-03T13:11:10.501799Z

@cfleming has joined the channel

2022-12-03T14:07:19.916659Z

@jackrusher has joined the channel