Fork me on GitHub
#cider
<
2018-06-15
>
bbss10:06:33

I recently updated my prelude packages, and now I have an issue where I can still start a shadow-cljs repl and have it autobuild. But inline evaluation tells me it needs a cljs repl and I probably need to jack-in. I've tried to cider-assoc-buffer-with-connection manually. But that doesn't change it.

bozhidar21:06:59

I haven’t investigated what’s wrong with shadow-cljs exactly, but I also don’t recall any changes on our end recently that might have caused this.

richiardiandrea21:06:29

@bbss yes, I am setting the repl type manually on my side now...I personally too, haven't had time to investigate more

bbss21:06:35

Okay thanks! using cider-repl-set-type seems to have done the trick, I'll read up a bit more if I run into it again. I only recently started using shadow-cljs (it's great). It was working earlier, maybe I messed up an emacs setting.

bozhidar21:06:29

More likely something is messed up with the repl type detection with shadow, but I haven’t had time to debug it, and it seems no one else had time for this as well.

richiardiandrea21:06:30

well, not manually but with something like:

(defun ar-emacs-cljs-shadow-select-repl ()
  "Return the init form a running shadow-cljs REPL."
  (interactive)
  (save-some-buffers)
  (let ((build-ids (read-from-minibuffer "Shadow-cljs build: ")))
    (ar-emacs-clj--send-to-repl
     (concat "(do (require 'shadow.cljs.devtools.api) "
             (format "(shadow.cljs.devtools.api/nrepl-select %s)" build-ids)
             ")")))
  (ar-emacs-clj--set-cljs-repl-type))

richiardiandrea21:06:54

(defun ar-emacs-clj--set-cljs-repl-type ()
  "Set the cider REPL type to cljs."
  (when (or (bound-and-true-p cider-mode)
        (equal major-mode 'cider-repl-mode))
   (with-current-buffer (cider-current-repl-buffer)
     (cider-repl-set-type "cljs")
     (cider-repl-return))))

bbss21:06:01

to make matters more complicated it's a chrome-extensions which runs in a slightly different browser context. It's (in early) support by shadow-cljs though and worked before. I might just have messed up my emacs..

bozhidar21:06:20

I haven’t merged the proposed workaround mostly because I’ve decided not to merge any PRs while we merge the big connection overhaul as I don’t want @vspinu to have to deal with conflicts there.

bbss21:06:29

@richiardiandrea cheers, appreciated!

richiardiandrea21:06:56

make sense @bozhidar, better to get that in 😉

richiardiandrea21:06:25

emacs is flexible enough that I can maintain a couple of lines of elisp for now 😉

bbss21:06:53

I should probably take some time to learn some elisp

richiardiandrea21:06:29

it's as fun as writing Clojure 😄

bbss21:06:38

hahah, unbelievable!

richiardiandrea21:06:41

I can say, better, at times

bbss21:06:05

ah really? I guess emacs gets better as you understand it better, so I can imagine.

richiardiandrea21:06:22

in terms of tooling it is super smooth imho

richiardiandrea21:06:29

debugging + REPL

richiardiandrea21:06:37

(well, cider has the same)