From d9503c157ab88f0ed2fa1301aeb57e95ac564760 Mon Sep 17 00:00:00 2001 From: Narendra Pal Date: Sun, 16 Jul 2023 22:47:55 +0530 Subject: [PATCH 1/2] Add generic rule for matching all clojure def types (#439) --- .github/workflows/test.yml | 2 +- dumb-jump.el | 53 ++++++++++---------------------------- 2 files changed, 15 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d185e6..008fb10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-python@v1.1.1 with: - python-version: '3.7.16' + python-version: '3.7' architecture: 'x64' - uses: purcell/setup-emacs@master with: diff --git a/dumb-jump.el b/dumb-jump.el index 97fbf5c..9936fbc 100644 --- a/dumb-jump.el +++ b/dumb-jump.el @@ -418,45 +418,20 @@ or most optimal searcher." ;; clojure (: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]")) + :regex "\\(def.*\ JJJ\\j" + :tests ("(def test (foo)" + "(defn test [foo]" + "(defn ^:some-data test [foo]" + "(defn- test [foo]" + "(defmacro test [foo]" + "(deftask test [foo]" + "(deftype test [foo]" + "(defmulti test fn" + "(defmethod test type" + "(definterface test (foo)" + "(defprotocol test (foo)" + "(defrecord test [foo]" + "(deftest test")) ;; coffeescript (:type "function" :supports ("ag" "grep" "rg" "git-grep") :language "coffeescript" From ede6a04187e79a29ef31d14760ac0d8d4c5f4cc5 Mon Sep 17 00:00:00 2001 From: "C.G.Vedant" Date: Sun, 14 Jan 2024 09:24:02 +0530 Subject: [PATCH 2/2] support solidity contract (#445) --- dumb-jump.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dumb-jump.el b/dumb-jump.el index 9936fbc..85dea7e 100644 --- a/dumb-jump.el +++ b/dumb-jump.el @@ -774,6 +774,10 @@ or most optimal searcher." :regex "error\\s*JJJ\\s*\\\(" :tests ("error test();" "error test (uint x)" "error test(uint x, address y)")) + (:type "contract" :supports ("ag" "grep" "rg" "git-grep") :language "solidity" + :regex "contract\\s*JJJ\\s*(is|\\\{)" + :tests ("contract test{" "contract test {" "contract test is foo")) + ;; R (:type "variable" :supports ("ag" "grep" "rg" "git-grep") :language "r" :regex "\\bJJJ\\s*=[^=><]" :tests ("test = 1234") :not ("if (test == 1234)"))