clojure-emacs / orchard

A fertile ground for Clojure tooling
Eclipse Public License 1.0
326 stars 54 forks source link

`fn-refs` never returns references from tests #176

Closed vemv closed 1 year ago

vemv commented 1 year ago

From some reason, given the var #'foo and a test #'foo-test that references foo, #'foo-test will never be included as a reference in fn-refs.

vemv commented 1 year ago

Easy one fortunately. If there's :test metadata, we should hit that instead:

> (-> #'orchard.eldoc-test/test-eldoc meta :test orchard.xref/fn-deps)

#{#'orchard.eldoc/eldoc
  #'clojure.core/hash-map
  #'clojure.test/*testing-contexts*
  #'clojure.core/cons
  #'clojure.core/str
  #'clojure.test/do-report
  #'orchard.info/info-java
  #'clojure.core/gensym
  #'clojure.core/not
  #'clojure.core/apply
  #'orchard.eldoc-test/test-eldoc-info
  #'clojure.core/list
  #'orchard.eldoc-test/test-eldoc-info-special-form
  #'clojure.string/trim
  #'clojure.core/push-thread-bindings
  #'clojure.core/pop-thread-bindings
  #'clojure.core/conj
  #'clojure.core/=
  #'orchard.info/info
  #'orchard.eldoc-test/test-eldoc-info-candidates}