Fork me on GitHub
#cider
<
2016-07-26
>
dpsutton03:07:19

does anyone have any examples of refresh hook functions they use?

richiardiandrea05:07:02

@dsutton you mean a function that calls tools..../refresh :after ..)?

dpsutton12:07:59

or, really, an example of what an after cider refresh function would do

malabarba13:07:33

@jsa-aerial: no, it doesn't mess with C-x C-e

dhruv114:07:32

I am inside a clojurescript project and I’m using emacs and nRepl and cider for development. I am also using figwheel (server?). I start the lein server from my terminal lein repl :headless and use cider-connect C-c M-c to connect to the lein server after i start figwheel and run this command (figwheel-sidecar.repl-api/cljs-repl) i can no longer compile code from a file. i.e. running C-c C-k doesn’t work and i get this message in my *Messages* buffer.

dhruv114:07:12

user-error: `cider-eval-defun-at-point' needs a Clojure REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-j').
Mark set

dhruv114:07:11

Update: I just tried using the cider-jack-in command to start and connect to a repl from emacs. I get the same error

dpsutton15:07:33

lot of good stuff in there. I'll be taking many cues from that. Thanks for sharing that @richiardiandrea

richiardiandrea15:07:39

ah ah no problem feel free 😉

malabarba16:07:50

@dhruv1 is that a Clojure file you're working on? Or a Clojurescript file?

dhruv117:07:31

@malabarba: it also doesn’t work for a cljs file

dhruv117:07:12

realized the problem was here:

(defun cider-connection-type-for-buffer ()
  "Return the matching connection type (clj or cljs) for the current buffer."
  (cond
   ((derived-mode-p 'clojurescript-mode) "cljs")
   ((derived-mode-p 'clojure-mode) "clj")
   (cider-repl-type)
   (t "clj")))
for my cljs file the major-mode isn’t clojurescript-mode. therefore, it (`cider-connection-type-for-buffer`) defaults to clj type. my current cider-connection-type-for-buffer is cljs and therefore it wasn’t working. tldr; after setting the major-mode in a cljs file to clojurescript-mode i can compile the file using C-c C-k without getting an error,.

ag18:07:28

anyone has problems with connecting to repl from CIDER?

nrepl--direct-connect: [nREPL] Direct connection failed

ag18:07:20

jacking-in not working as well

dhruv119:07:47

@ag: you can toggle-edebug-on-error to narrow it down further. but to answer your question, I didn’t have a problem with cider-jack-in

ag19:07:26

@dhruv1: I rolled back to Emacs 24 and now it works. I tried installing Emacs 25, apparently something broke.

malabarba20:07:49

@ag: yes, someone else reported that here recently

malabarba20:07:08

I said I'd try to reproduce and forgot about it

malabarba20:07:50

Something changed in the interaction with the subprocess which broke jack-in