Fork me on GitHub
#cider
<
2017-03-20
>
nikki05:03:03

saving a buffer with a figwheel connection open some times hangs for a while

nikki05:03:07

seems it's because of indentation stuff

daveliepmann09:03:17

I'm on CIDER 0.15.0snapshot (package: 20170122.2028) and I want to check if the new-ish behavior I'm seeing with fn parameter highlighting is intentional, and if so...if it could not be? For example, if I have code like (contains? (:data foo) :squuid) and I put the cursor at the open-paren of (:data foo) the minibuffer shows me clojure.core/contains?: ([coll key]), with coll bolded so I know it's the argument at point—that's great. I love it. But the new behavior when I move my cursor to anywhere on :squuid is to show me the (useless) fn parameters for :squuid, when what I (and I assume reasonable persons) want is to keep the contains? parameter list, and bold key. Or, consider another example: (update foo :data dissoc :squuid), where putting the cursor near dissoc gives me dissoc's parameter list, rather than helping me tell that dissoc is in the correct position within update. The behavior I'd prefer is to highlight the parameters only of functions currently in parens.

negaduck16:03:02

hello. I’d like to connect to cljs repl the figwheel started for me. I usually do M-x cider-connect, then evaluate (use ‘figwheel-sidecar.repl-api)(cljs-repl). The problem is I don’t have clojure locally, it runs in a docker container and M-x cider-jack-in-clojurescript tries to install everything for me. I’m ok with copy/pasting that line, but still would like to save a step. Is there a way to eval that after cider connected to nrepl?

dpsutton16:03:26

after you cider-connect, try running cider-create-sibling-cljs-repl

dpsutton16:03:04

although it looks like that creates a new process and everything

dpsutton16:03:17

as far as I can see, you'll need to just run those manually

negaduck16:03:00

@dpsutton, yes, sadly, I can’t make them play together in elisp.

dpsutton16:03:44

(cider-nrepl-send-request
       `("op" "eval"
         "ns" ,(cider-current-ns)
         "code" ,cljs-repl-form)
       (cider-repl-handler (current-buffer)))

dpsutton16:03:52

i think this is exactly what code is eval'd to do it

dpsutton16:03:04

so if you want to make your own "i'm connected, start up my repl" function

dpsutton16:03:18

and here, just replace the ,cljs-repl-form with whatever invocation you need

negaduck16:03:09

@dpsutton, can’t make this work, but thanks anyway

dpsutton16:03:06

what error are you getting?

dpsutton16:03:26

actually i've got to head to lunch and then a meeting. if you are around this evening i'll be on and we can chat more

negaduck17:03:06

@dpsutton, I ended up with this:

(defun tmp-cider ()
  (interactive)
  (cider-connect "cljstest_figwheel.dev.dnsdock" 7888 (projectile-project-root))
  (with-current-buffer (cider-current-repl-buffer)
    (insert "(use 'figwheel-sidecar.repl-api) (cljs-repl)")
    (funcall (key-binding (kbd "RET")))
    (setq cider-repl-type "cljs")
    ))

negaduck17:03:49

not the prettiest code, but seems to work

dpsutton17:03:47

It ain't pretty but that's kinda Emacs. It'll get the job done :)