Fork me on GitHub
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


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


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.


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


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


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


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


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


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

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


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


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