Fork me on GitHub
#cider
<
2017-03-08
>
samedhi04:03:57

Should have mentioned, this is the task I am running to M-x cider-connect to my repl, which I then call (start-repl) from:

samedhi04:03:05

(task-options!
 cljs      {:compiler-options {:language-in :ecmascript5-strict}}
 test-cljs {:js-env :slimer}
 reload    {:port 7800}
 repl      {:port 6800, :bind "0.0.0.0"})

(deftask development
  "Launch Immediate Feedback Development Environment"
  []
  (comp
   (serve)
   (watch)
   (reload)
   (cljs-repl) ;; order is important!
   (cljs)
   (target)))

Yehonathan Sharvit08:03:21

Cider really rocks!!!

Yehonathan Sharvit08:03:45

Is there a way to reload cider after updating project.clj?

benedek09:03:47

not sure what you mean exactly but if you use clj-refactor you can load a new dependency into an existing repl

benedek09:03:49

so you don’t need to restart

chrisblom09:03:54

does cider (or clj-refactor) have a command to refactor fully qualified symbols to a require entry in the ns + an aliased symbol?

chrisblom09:03:00

So for example, foo.bar.baz/quux would be replaced with baz/quux and [foo.bar.baz :as baz] would added to the :require of the ns

chrisblom09:03:38

I vaguely remember using such a command, but i can't find it anymore.

benedek09:03:05

wondering if clean ns does this or not… not sure

benedek09:03:50

so what you could try is to add a require with an alias. you can do this with clj-refactor’s add require

chrisblom09:03:50

no, that just cleans up the ns form

benedek09:03:20

and after that clean ns may or may not do this for you. not sure tbh

dominicm09:03:31

It doesn't afaik. If you've aliases foo.bar.baz to baz elsewhere, if you type "baz/quux" the magic requires will require foo.bar.baz :as baz for you

benedek10:03:51

yeah but won’t change all the occurrences of fully quialified usage in the code.. tbh worth a feature request or even a PR 😉

chrisblom10:03:40

i'll look into it

dominicm10:03:05

As long as I get some nrepl ops to hook into, I'm happy 😛

dominicm10:03:28

@benedek friendly neighborhood vim user, just here for the nrepl ops

benedek10:03:06

you mean you just call cider/cljr directly from the repl?

dominicm10:03:09

I think everything you need might be there, except perhaps a new find op

dominicm10:03:22

uh, not quite. cljr-refactor.nvim, fireplace.vim, async-clj-omni, etc. do all the ops for me.

benedek10:03:33

ah yup right.

benedek10:03:56

in theory you could do the refactoring from the repl. but nobody really does that...

dominicm10:03:27

@benedek Some of it requires your editor I think? because you have to take the results of those operations (find me all uses of foo.bar/baz) and then (for the case of global-rename-symbol) the editor changes it to foo.bar/baz2.

benedek10:03:14

yes you are right. but in theory you could have a client implemented in clojure used from the repl

benedek10:03:48

there is suçh a client for testing purposes in cljr itself. not given much love lately...

benedek10:03:22

i mean a client implemented in clojure which does the necessary file operations etc...

dominicm10:03:02

O RLY? That is extremely interesting, I need to check that out.

dominicm10:03:26

@benedek I'm not seeing it, do youhave a link?

richiardiandrea15:03:35

I have recently discovered that emacs natively parses JSON, I have always associated the need for a Java nrepl with a need of a Java encoder/decoder for communication

dominicm16:03:01

Nrepl doesn't use JSON

richiardiandrea17:03:13

That's what I am saying, I thought that nrepl was necessary because the protocol dictated it

richiardiandrea17:03:19

Wrong assumption

dpsutton17:03:04

i think clojure has support baked in for bencode so that's why the choice was made

richiardiandrea17:03:35

oh ok, that's what I remembered

dpsutton17:03:35

there's also another transmission format that i'm not thinking of off hand right now

benedek21:03:30

in cljr we use edn and expez’s elisp edn package

dpsutton21:03:23

i remember bbatsov hesitant to do that because of how old and "alpha" the emacs edn side was

richiardiandrea21:03:56

in theory we could use transit over json no elisp does not support it 😄

dpsutton21:03:17

if you wrote a transit client in elisp?

richiardiandrea21:03:33

lol I was about to correct