Fork me on GitHub
#cider
<
2019-10-19
>
Thanh Vuong05:10:11

What is cider function that can work like cider-find-var but for symbols which are functions arguments? For example with this fn: (defn me [a b] (+ a b)) if my cursor is on symbol a on line 2, what will take me to the definition of a in line 1? Thanks

yuhan05:10:57

I usually just use text-based commands for that, like the auto-highlight-symbol package

yuhan05:10:05

ahs-forward and ahs-backward in particular, inside a hydra which makes visually jumping around very fast

Thanh Vuong06:10:55

thanks, I am using something similar to yours (`#` or * in spacemacs), but it feels lacking. I wish I have a function that jumps straight to the argument definition like cider-find-var does for other symbols other than function arguments.

yuhan06:10:07

Hmm, you could probably look at cider--parse-and-apply-locals for reference and hack together something of the sort

yuhan06:10:09

For myself, what I'd find useful is a cider-find-ns-var command that would completing-read all the vars in scope in the entire project, similar to Emacs' find-function / find-variable

bozhidar15:10:32

@qythium If I recall correctly cider-find-var actually does this. Just press TAB. đŸ™‚

yuhan16:10:16

Hmm, I couldn't get this to work.. pressing TAB doesn't do anything

bozhidar15:10:10

Now that it’s easy to parse a method definition using parse-clj we can provide some lookup of locals relatively easy.

ag19:10:54

when you create a test namespace file, it gets created with a specific header, i.e. it automatically makes something like:

(ns my-app.foo
  (:require  [clojure.test :as t])
I would like to change this so it is always like this:
(ns my-app.foo
  (:require  [clojure.test :refer [deftest is testing]])
can somebody please point me to the relevant elisp code that is responsible?

dpsutton21:10:02

That’s probably refactor I think? Clojure mode does the insert but I think I remember refactor adding the test stuff?

yuhan22:10:41

yup that's the variable cljr-clojure-test-declaration

4