Fork me on GitHub
#cider
<
2018-03-15
>
wusticality02:03:35

is there some way in cider to list all of the places a function is used?

wusticality02:03:19

looks like https://github.com/clojure-emacs/clj-refactor.el has this but I know that’s outside cider ..

wusticality03:03:47

Can’t get it to work on my end - at any rate, this feature would be so unbelievably useful, I’m curious why it’s not present tbh

didibus04:03:11

Would love to see unrepl support in Cider, I wouldn't mind my Clojurist Together money to go help make that happen.

didibus04:03:04

@iwannaseethelight You can do that with cljr-find-usages. CIDER should auto inject refactor-nrepl which is the middleware used by clj-refactor. So it should work with Cider. Just do Cider jack in, and then put the point over a symbol, and run cljr-find-usages.

didibus04:03:44

It does require your project to compile properly, otherwise the analysis fails

wusticality04:03:29

yeah trying to get that working, i just get a massive exception

didibus04:03:33

Its definitely a bit wonky, all the clj-refactor refactorings are

wusticality04:03:56

is clj-refactor supposed to complement cider?

didibus05:03:31

@iwannaseethelight I think it can be used independently. You could install just that, and add the nRepl middleware in your project's dependencies manually.

didibus05:03:18

But Cider just makes it nicer by injecting the middleware, and maybe it bundles clj-refactor with it, I'm not sure, since I use spacemacs, I might have gotten it seperatly from the clojure layer

bozhidar08:03:11

@didibus That’s not true. clj-refactor is a CIDER extension, you can’t use it without CIDER. 🙂 It adds additional middleware and Emacs commands, but also relies on the presence of the core CIDER functionality.

bozhidar08:03:22

> is clj-refactor supposed to complement cider?

bozhidar08:03:06

@iwannaseethelight basically yes. I also consider it a testbed for experimental features that might potentially be pulled upstream into CIDER itself.

bozhidar08:03:42

> Would love to see unrepl support in Cider, I wouldn’t mind my Clojurist Together money to go help make that happen.

bozhidar08:03:31

@didibus That’s in our plans, but it requires a bit of work and time to do that work. I hope we’ll get there at some point this year, but we also plan to make some good improvements to nREPL in the mean time.

bozhidar08:03:37

Exciting times ahead! 🙂

bozhidar10:03:56

Btw, while I’m as excited about unrepl (and new ideas in general) as everyone else, I don’t think that simply adopting it will make some huge difference for end users right away. ClojureScript support would be easier, and we’d get things like elided collections and sideloading, but someone also has to port all the existing functionality to the new API and there’s also the problem that parseclj is still young and rough around the edges, etc.

bozhidar10:03:05

I think in the end of the day the most important thing is the end user experience, and not the underlying implementation. After all - first and foremost we want to get things done. 🙂 That’s why for me it’s important to keep improving what we have and its foundations, while also working towards supporting additional REPLs.

bozhidar10:03:49

And, btw, there’s also the point that a lot of big gains can be made from improving nREPL itself - e.g. adding something like elided collections functionality should not be very hard, and with relatively small piggieback improvements you can mostly eliminate the need for having two REPL connections per project.

pauld14:03:37

I updated my my earlier issue and submitted a bug report here: https://github.com/clojure-emacs/cider/issues/2236

pauld14:03:32

It looks like cider-nrepl has namespace renaming turned off for the tools.nrepl dependency only.

pauld14:03:15

This can sometimes cause issues for projects that have the cider-nrepl dependency.

pauld14:03:52

I can confirm that turning namespace renaming back on solves my issue, but likely breaks debugging middleware that depends on namespace renaming being turned off.

pauld14:03:57

Should I resubmit this bug in cider-nrepl?

bozhidar14:03:09

> It looks like cider-nrepl has namespace renaming turned off for the tools.nrepl dependency only.

bozhidar14:03:37

The problem is that that’s a namespace you can’t alias, otherwise the middleware won’t work. 🙂

bozhidar14:03:39

> I can confirm that turning namespace renaming back on solves my issue, but likely breaks debugging middleware that depends on namespace renaming being turned off.

bozhidar14:03:10

Is something even working when you rename the nREPL namespaces?

bozhidar14:03:55

I’ll take a look at the ticket, but because almost always cider-nrepl depends on the latest nREPL and so do projects, conflicts between the two are very uncommon.

pauld14:03:05

Yeah, I don't actually need cider-nrepl it was just sitting in my .profiles.clj for some historical reason.

pauld14:03:30

But just having it there broke my compilation in cider.

pauld14:03:25

sorry I mean tools.nrepl

pauld14:03:49

I think I just like solving a juicy mystery 😉!

Michael Fiano17:03:04

Is it strange that cider-jack-in from a clojure project buffer only connects to a REPL, but does not show the REPL buffer? I have to manually switch to the buffer it creates, or call cider-switch-to-repl-buffer to use the REPL.

mikerod18:03:32

@mfiano I haven’t seen that . What version of cider by the way?

Michael Fiano18:03:19

@mikerod ;; CIDER 0.17.0snapshot (package: 20180312.26), nREPL 0.2.13

Michael Fiano18:03:29

@seancorfield Thanks! That was what I needed

pre19:03:56

Existing Cider/Lein user here; Has anyone successfully used a fresh emacs/inf-clojure setup with Lumo (no lein or boot installed) and connected to a repl? I'm currently unable to do so following the instructions on inf-clojure's README https://github.com/clojure-emacs/inf-clojure After adding ((nil . ((inf-clojure-boot-cmd . "lumo -d")))) in .dir-locals.el of my emacs,d setup, running M-X inf-clojure still complains about not finding lein on path. Suggestions?

Garrett Hopper19:03:58

How can I manage what connection a particular buffer is using? I have a setup with 3 repls (1 clj, 2 cljs). Do I just need to set cider-request-dispatch to static and start managing the default connection myself?

wusticality20:03:09

Hi @magnars, always exciting to see you around, you are an Emacs legend. 🙂

gonewest81820:03:55

Is there an example in the cider-nrepl middleware that enriches or modifies other messages? What I mean is, not an “op” you invoke directly but rather something that watches for values being returned by other evaluations and transforms them? I looked at pprint, but that’s not quite the pattern I mean. I don’t think I need to pass anything in, just want to “filter” on the way out.

gonewest81821:03:13

… looking at tools.nrepl.middleware.pr-values

wusticality23:03:50

Hey guys, I’m sure I’m missing something trivial, but instrumenting an entire defn works fine, but I can’t seem to get #break / #dbg to work, any leads?

wusticality23:03:42

Oh interesting, it works if I reevaluate the method via cider-eval-defun-at-point, but if I reload the buffer via cider-load-buffer it does not. Perhaps cider-load-buffer does not do what I think it does.

wusticality23:03:56

I was under the impression that it reevaluated every function in the buffer, no?

wusticality23:03:03

Perhaps I’m missing something here, I guess if I modify a function I have to instrument it for it to be debuggable, that it?

wusticality23:03:16

I’m also curious if I have to manually instrument every function I want to step into.

gonewest81823:03:47

You can step into other functions once you’re in the debugger.

wusticality00:03:15

Hey @U4PUTN69G - when I instrument a function and the debugger breaks in it, I can’t seem to step into functions inside of that function. Do I have to instrument any function I wish to step into ahead of time?

gonewest81800:03:02

That sounds wrong. Let me go get my laptop

gonewest81800:03:11

No, you can definitely step into functions that aren’t instrumented including library functions you didn’t write.

gonewest81823:03:23

I typically instrument functions with C-u C-M-x as described here (https://github.com/clojure-emacs/cider/blob/master/doc/debugging.md). If there’s any doubt what is instrumented and what isn’t, you can M-x cider-browse-instrumented-defs which is also documented if you follow the link.