Fork me on GitHub
#cider
<
2018-03-05
>
bozhidar06:03:20

Meaningful errors when you try to start something without having added its deps.

bozhidar06:03:40

Airport productivity for the win. 😄

Eoin11:03:05

"cider-find-reusable-repl-buffer: Symbol’s function definition is void: cider--select-zombie-buffer" anyone else getting this from cider-jack-in?

bozhidar13:03:32

Hmm, that’s odd. I haven’t touched this one.

bozhidar14:03:45

Ops, now I noticed what I’ve done. I’ve wrapped more expressions in one let then I meant to. Sorry about this!

bozhidar14:03:52

@eoin @manuel Just fixed this on master.

manuel14:03:43

thank you, @bozhidar. I hard reset to 6c16e8af62bf6101dbe3a15919ff8d6ab4f0f977 for now because I'm in the office, but I'll try the fix as soon as I get home.

bozhidar14:03:26

I keep telling myself not to put new features hastily together, at some point I should also start listening to myself.

manuel14:03:11

no worries, I have no problem testing bleeding edge CIDER and using Git for cases such as this. Which, by the way, happen rarely 😉

dpsutton15:03:07

gonna have to investigate this one. the figwheel check fails but when i remove that check the build succeeds

dpsutton15:03:37

hmm. i think we've been sending invalid code fora while. check out ciderrepl-set-initial-ns`:

(let* ((response (nrepl-send-sync-request
                        (lax-plist-put (nrepl--eval-request "(str *ns*))")
                                       "inhibit-cider-middleware" "true")
                        (cider-current-connection)))
             (initial-ns (or (read (nrepl-dict-get response "value"))
                             "user")))
        (cider-set-buffer-ns initial-ns))

dpsutton15:03:50

note (str *ns*))

dpsutton15:03:15

(-->
  id                       "4"
  op                       "eval"
  session                  "1a7c6cb2-64c9-4a10-b598-f6a153feb31c"
  time-stamp               "2018-03-05 09:18:33.480233757"
  code                     "(str *ns*))"
  inhibit-cider-middleware "true"
)

(<--
  id         "4"
  session    "1a7c6cb2-64c9-4a10-b598-f6a153feb31c"
  time-stamp "2018-03-05 09:18:33.527592981"
  err        "RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:221)
"
)

dpsutton15:03:50

ok. the cljs checking is fundamentally broken in its current state. (find-ns 'figwheel-sidecar.repl-api) fails but that doesn't mean that figwheel isn't on the classpath. the figwheel startup is to require it which does succeed.

(->> (all-ns)
     (map str)
     (filter (fn [ns] (clojure.string/starts-with? ns "figwheel"))))
but then (do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl)) succeeds

mikerod16:03:17

I don’t have a comment on improving find-ns, but I do have a question that is in that same domain. I have in my emacs setup

;; Set to the required key in cider.el const `cider--cljs-repl-types`
(setq cider-cljs-lein-repl
      "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))")

mikerod16:03:39

Is this the way that you are supposed to setup the preferred cljs repl (for jack in/create sibling)?

mikerod16:03:01

It seems weird that I just copy/pasted that string from cider.el I’m pretty sure I must have missed something

dpsutton16:03:18

at the moment you want to set cider-default-cljs-repl to that string

dpsutton16:03:47

it would be nice to let you just (setq cider-default-cljs-repl-type "figwheel") and let it look up the required form

mikerod16:03:41

@dpsutton Yeah, that is a big string and I think you have to be sure it is exact

mikerod16:03:45

So that is a pretty weird interface

mikerod16:03:21

I was surprised and thought I must be missing some higher-level opt

dpsutton16:03:53

mikerod, if you C-h C-f to find function and look at cider-create-sibling-cljs-repl you'll see where it checks to see if you have already set a repl invocation

dpsutton16:03:11

yeah. it's been like that for a while. when setting it i always have to go spelunking in the code to see what the form is

dpsutton16:03:16

it needs to change

dpsutton16:03:48

should have an option for specify the type and use CIDER's string for it, specify your own invoke form, or the select that bohzidar added recently (which is really nice)

mikerod16:03:50

Yeah, this is how I found it in the first place - via code searching

mikerod16:03:58

and seeing how it looked it up

dpsutton16:03:06

do you want to file and issue? I might be able to tackle that tonight

mikerod21:03:26

@dpsutton I actually see this Cider issue https://github.com/clojure-emacs/cider/issues/2202 that I think covers this topic we discussed earlier around setting the awkward cider-cljs-lein-repl var

dpsutton21:03:00

add a comment on there. "i'd like to be able to set the type to figwheel and it know the invocation required for that rather than setting it to the actual invocation" but otherwise you are right. but that's a perfect spot for that feedback

dpsutton16:03:28

and if you are jacing in with clojurescript you're probably gonna run into the issue of CIDER incorrectly telling you your project is not setup for clojurescript

mikerod16:03:06

My recent pattern has been cider-jack-in (for clj), then cider-create-sibling-cljs-repl I don’t remember trying more direct cljs jack in before, but perhaps that’s why I ended up down this path

mikerod16:03:16

I can file the issue in a bit, yep

dpsutton16:03:17

awesome. thanks

dpsutton16:03:35

i always just cider-jack-in-clojurescript and it handles everything

mikerod16:03:53

I’ll try that one out. I only recently started using jack in

mikerod16:03:44

I think a long while ago I used to have issues with it. So I just started a habit of starting a headless lein nrepl server and connecting via cider-connect for a long time. One day I finally decided to give it a shot again with jack in and it is nice

mikerod16:03:56

cuts down so many steps I was taking hah

dpsutton16:03:59

give it a whirl and file any issues you run into. if you run into any i bet they are easily solved and it gets better for everyone

mikerod16:03:16

I’d like to start paying a bit closer attention to cider internals (and nrepl middleware) to be able to contribute back better. Especially since there are frequent request here for more contribution.

mikerod16:03:41

The worst aspect for me is still the elisp stuff. I’m just not that used to it

dpsutton16:03:48

check out http://hackingcider.com for some info on the internals, readthedocs and always ask in here!

mikerod16:03:50

(haven’t spent that much time on it really)

mikerod16:03:02

oh, cool. I don’t think I’ve read this

dpsutton16:03:09

no biggie. should come naturally a bit after looking at some of the code around your changes

mikerod16:03:18

I’m not completely ignorant with elisp either. I’ve done some research before. Just not super proficient. I can still track through cider code more or less I believe. Thanks for the advice and link too.

gonewest81817:03:00

I’ll be the first to admit not being super proficient with elisp. But one can still get things done. The PR feedback and guidance from the project goes a long way.