Fork me on GitHub
#babashka
<
2021-10-12
>
andrea.crotti19:10:35

I saw that cider is not yet very integrated with babashka, did anyone hack something together in the meanwhile?

andrea.crotti19:10:23

it would be pretty easy to just at least start the bb --nrepl-server in a comint process and do a cider connect right?

javahippie19:10:57

That works, and is the recommended way in the Cider docs 😉 https://docs.cider.mx/cider/platforms/babashka.html

andrea.crotti20:10:11

yes that's what I'm already doing

andrea.crotti20:10:25

I'd like to do even less though 😄

andrea.crotti20:10:48

but well I can do it myself with a few lines of elisp

borkdude20:10:02

perhaps you can make a package on melpa for it :)

andrea.crotti21:10:15

Hehe well I think it's just 3 lines and will probably be done in cider anyway

andrea.crotti21:10:33

But if it works I'll share it somehow

borkdude21:10:35

perhaps you can make a PR to cider

mmz10:10:25

Super curious how it can be done even quicker than cider connect and then type localhost + port. Related: https://github.com/babashka/babashka/discussions/907

andrea.crotti20:10:06

tbh it's just something like

(defun bb-and-connect ()
  (interactive)
  (make-comint "bb-nrepl" "bb" nil "--nrepl-server")
  (sleep-for 2)
  (cider-connect '(:host "localhost" :port 1667)))

1
andrea.crotti20:10:24

which kind of works already but of course it's not particularly smart

andrea.crotti20:10:26

this fails if you do it twice since it would try to bind the same port again of course, but it's quite easy to improve as well

andrea.crotti20:10:04

and yes ideally it should just be part of cider even though the workflow is a bit different, but also something like this is already enough for me

andrea.crotti20:10:48

I've done a few changes and pushed to https://github.com/AndreaCrotti/bb-nrepl

1
👍 1
andrea.crotti20:10:31

with the hook mentioned in https://github.com/AndreaCrotti/bb-nrepl/blob/main/bb-nrepl.el#L36 I just create a new bb file and everything works already, so 0 steps instead of 2 pretty much

andrea.crotti20:10:43

there are still a few things to iron out but I guess it's a start