Closed npcoder2k14 closed 1 year ago
After debugging it for a bit, I found out the regular expressions used are inadequate to support the above use-cases.
Regexes present in dumb-jump.el file -
(:type "variable" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(def\\s+JJJ\\j"
:tests ("(def test (foo)"))
(:type "function" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defn-?\\s+JJJ\\j"
:tests ("(defn test [foo]" "(defn- test [foo]")
:not ("(defn test? [foo]" "(defn- test? [foo]"))
(:type "function" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defmacro\\s+JJJ\\j"
:tests ("(defmacro test [foo]"))
(:type "function" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(deftask\\s+JJJ\\j"
:tests ("(deftask test [foo]"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(deftype\\s+JJJ\\j"
:tests ("(deftype test [foo]"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defmulti\\s+JJJ\\j"
:tests ("(defmulti test fn"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defmethod\\s+JJJ\\j"
:tests ("(defmethod test type"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(definterface\\s+JJJ\\j"
:tests ("(definterface test (foo)"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defprotocol\\s+JJJ\\j"
:tests ("(defprotocol test (foo)"))
(:type "type" :supports ("ag" "grep" "rg" "git-grep") :language "clojure"
:regex "\\(defrecord\\s+JJJ\\j"
:tests ("(defrecord test [foo]"))
Consider the function is listed in the following way -
and called in the following way -
On invoking the
xref-find-definitions
function onhello-world
. It doesn't list the above defined function.The same happens when you try to find tags defined by
deftest
. Eg: -