Fork me on GitHub
#cider
<
2017-01-03
>
dpsutton00:01:45

i'm really glad. I saw there was a lot of activity

dpsutton00:01:54

looks like your patch has fixed quite a bit πŸ™‚

bhagany01:01:49

Heh, just the same bug, reported lots of different ways :)

qqq04:01:55

Using cider, can I get something like "neotree", but instead of showing all files in a directory, it shows me def/defmacro/defns within a single *.cljc file ?

dpsutton04:01:45

check out imenu

dpsutton04:01:58

i think it similar to what you are thinking

qqq04:01:51

I was just looking at speedbar (which works on .el files), but it does not work on clj files yet; will look into imenyu now; thanks!

dpsutton04:01:03

you could also use occur and loccur

dpsutton04:01:29

loccur collapses the current buffer down to whatever matches the pattern you gave it

dpsutton04:01:40

so its easy to browse the defn's and the press enter on the one you like

benedek16:01:05

anybody knows how to start a cider repl for a cljs/node project? is a there an up to date howto, guide etc?

benedek16:01:23

i was trying various things and always ended up at weird places πŸ˜‰

dpsutton16:01:34

"should be" automatic

dpsutton16:01:38

assuming its a lein project

dpsutton16:01:57

there's a defcustom called lein-cljs-repl-type or something similar

dpsutton16:01:16

basically this holds a sequence of commands that are run after jacking in

dpsutton16:01:34

and there are several options that should cover most use cases

dpsutton16:01:40

do you know what connector they are using?

benedek16:01:10

piggyback i think

dpsutton16:01:32

hmm, well that's the default value

dpsutton16:01:52

can you tell me the value of cider-cljs-lein-repl

benedek16:01:51

"(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))”

benedek16:01:23

but for node i need this one?:

("(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
     "Node" " (requires NodeJS to be installed)”)

benedek16:01:30

sry bit confused here i guess...

dpsutton16:01:43

honestly i'm not too sure

benedek16:01:57

haha, how do i switch to that one?

dpsutton16:01:13

you can do it through the customize-group menu

dpsutton16:01:30

or if you just want it local to this project, set a dir-local variable

benedek16:01:55

ah yeah of course, sry just set the value of cider-cljs-lein-repl

dpsutton16:01:50

let me know if it works out for you

Chris Bidler16:01:02

You might also be looking for cider-jack-in-clojurescript and not cider-jack-in, depending on how your project is set up

Chris Bidler16:01:03

the former starts a Clojure REPL and then bootstraps a CLJS REPL, the latter just starts a Clojure REPL and then you can start a CLJS environment however you like with e.g. (boot β€œrepl”) or start some Component

ustunozgur17:01:15

In cider, let's say I'm in a (comment) block. Is there a builtin way to make C-M-x work there, but one level below the comment?

ustunozgur17:01:03

Currently, I need to go to the end of the form I want, and do C-x C-e, but outside (comment) forms, C-M-x work anywhere.

dpsutton17:01:43

C-M-x works anywhere, including comment blocks

dpsutton17:01:01

its just the form returns nil

dpsutton17:01:36

you're asking if there's a way to recognize that you're in a comment block and eval the form underneath it?

dpsutton17:01:35

I like that idea but i'm not sure there is a way to do it

dpsutton17:01:46

by that i mean it hasn't been implemented

ustunozgur17:01:50

just to see the result.

dpsutton17:01:52

i'm sure there's a way to do it

ustunozgur17:01:08

OK, nice. I'll try to see if I can implement and then contribute.

richiardiandrea17:01:57

@ustunozgur I am totally with you I have been wanting to implement that myself for a long time

qqq18:01:09

what's a good guide on using cider for debugging?

qqq18:01:16

I'm reaching the point where pprint is no longer cutting it

qqq18:01:32

ah; it's working now, apparently my main problem was evil vs cider battling for keys

qqq18:01:40

(defn make-handler [nm] (fn [o] #break 2 #_ (throw (ex-info nm o)))) (defn f2 [x] #break (+ x 2)) (f2 4) ((make-handler "foo") {:a 2}) does #break only work in defns, and refuse to work inside anonymous functions?

practicalli-johnny19:01:58

@qqq @dpsutton have you tried M-x cider-browse-ns to view the def/defn in a namespace? Once a REPL is running you can browse the contents of any namespace loaded into the REPL

benedek19:01:23

@dpsutton setting this as a dir local:

((nil
  (cider-cljs-lein-repl . "(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))")))
worked for a node.js cljs repl. ta!

dpsutton19:01:33

thanks for letting me know benedek. glad it worked

dpsutton19:01:47

i'm keeping an eye out for cljs interaction as i think it is weaker than clj support

dpsutton19:01:01

@jr0cket i always forget about that one. thanks for reminding me

ustunozgur19:01:58

Is there a way to clean up the whitespace near the closing parantheses automatically? For example, say I have the following:

(defn foo []
          (bar x)
)
Is there a way to move the last paren to the end of the last line?
(defn foo []
         (bar x))

ustunozgur19:01:59

Currently, I go to the end of the bar line, and keep hitting C-k until it deletes everything.

ustunozgur19:01:10

I guess paredit should have something builtin for this.

qqq19:01:32

I use evil. I put cursor anywhere on the (bar x) line, and hit shift-J

geoffs22:01:50

@ustunozgur if you're using paredit, you can just type the closing paren anywhere between the end-paren of (bar x) and the next paren. Actually, I think it works anywhere between the open and close paren of the pair surrounding the defn as long as you're not inside a nested set of delimiters.