Fork me on GitHub

@andrea.crotti No. Jump to definition uses some location metadata that’s available just for vars. In theory doing this won’t be very hard - we can just try the regular resolution, fail and see if we’re in a let and try going higher and higher in nest lets.


> Hi! I’m using cider with re-frame and figwheel, so I have a lot of definitions like (reg-sub :my-event ...) is there any way to navigate to that keywords using cider?


@achikin CIDER still doesn’t have “find references” functionality built-in, but clj-refactor.el has it.


> So with cider there’s a function you can add to you config file named cider-annotate-completion-function and it says that the 2 arguments it takes are the abbreviations from cider-completion-annotations-alist (I configured that already) and the namespace that candidate is from. So do I put (cider-annotate-completion-function "c" "clojure.core") etc etc?


The abbreviations indicate the type of something - function, macro, etc.


Basically for each item on the completion list this the function receives the type of the thingy and it’s namespace. The default behaviour in just to concatenate those, but you can define a new function that does something fancier. But you’ll also have to change the logic for figuring out the type of candidates.


The types come straight from the middleware though.

(defun cider-completion--parse-candidate-map (candidate-map)
  "Get \"candidate\" from CANDIDATE-MAP.
Put type and ns properties on the candidate"
  (let ((candidate (nrepl-dict-get candidate-map "candidate"))
        (type (nrepl-dict-get candidate-map "type"))
        (ns (nrepl-dict-get candidate-map "ns")))
    (put-text-property 0 1 'type type candidate)
    (put-text-property 0 1 'ns ns candidate)
so this is not a change you can easily do locally.


What you can do locally is to add some if in the annotation function to handle clojure.core differently.


P.S. We already use c for classes.


ah nice @bozhidar should I open a ticket to keep track of that?


I can also try to do it myself possibly


@andrea.crotti That’s fine by me - especially if you try to tackle it yourself. 🙂