Skip to content

Commit

Permalink
ignore "`" prefix from symbol for systemverilog, fixes #240 (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacktasia committed Nov 27, 2018
1 parent 0c89339 commit b35b841
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dumb-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,8 @@ to keep looking for another root."
(nth 1 (s-split "/" look-for)))
((and (or (string= lang "ruby") (string= lang "crystal")) (s-starts-with? ":" look-for))
(s-chop-prefix ":" look-for))
((and (string= lang "systemverilog") (s-starts-with? "`" look-for))
(s-chop-prefix "`" look-for))
(t
look-for)))

Expand Down
6 changes: 4 additions & 2 deletions test/dumb-jump-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,12 @@
(ert-deftest dumb-jump-process-symbol-by-lang-test ()
(let ((result (dumb-jump-process-symbol-by-lang "elisp" "somefunc"))
(result2 (dumb-jump-process-symbol-by-lang "clojure" "myns/myfunc"))
(result3 (dumb-jump-process-symbol-by-lang "ruby" ":myrubyfunc")))
(result3 (dumb-jump-process-symbol-by-lang "ruby" ":myrubyfunc"))
(result4 (dumb-jump-process-symbol-by-lang "systemverilog" "`myvlfunc")))
(should (string= result "somefunc"))
(should (string= result2 "myfunc"))
(should (string= result3 "myrubyfunc"))))
(should (string= result3 "myrubyfunc"))
(should (string= result4 "myvlfunc"))))

(ert-deftest dumb-jump--result-follow-test ()
(let* ((data '(:path "/usr/blah/test2.txt" :line 52 :context "var thing = function()" :target "a")))
Expand Down

0 comments on commit b35b841

Please sign in to comment.