summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2023-04-13 19:48:57 -0700
committerYuan Fu <casouri@gmail.com>2023-04-14 15:52:30 -0700
commit293029458c87d6ec18a6f6a5958d0b499310ca3b (patch)
tree0cc43727b42ab9617fafb6fa366a3e8a93c8482c /test
parenta4de6d8dd3b6a5ac39737812e17a2a8d766e9f3a (diff)
downloademacs-293029458c87d6ec18a6f6a5958d0b499310ca3b.tar.gz
Make use of the new pred shapes in treesit.el
treesit-search-forward and friends now accept more shapes for PRED, make use of it in navigation functions. * lisp/treesit.el (treesit-node-top-level): Use treesit-node-match-p. (treesit--thing-unpack-pattern): Remove function. (treesit-beginning-of-thing) (treesit-end-of-thing): Remove PRED argument. (treesit--things-around): Remove PRED argument, use treesit-node-match-p. (treesit--top-level-thing): Remove function. (treesit--navigate-thing): Remove PRED argument. (treesit-thing-at-point): Update docstring, don't unpack PATTERN. * test/src/treesit-tests.el: (treesit--ert-test-defun-navigation): Don't unpack pattern.
Diffstat (limited to 'test')
-rw-r--r--test/src/treesit-tests.el4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index ecdee3c26e4..5b2955c34e3 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -916,8 +916,6 @@ and \"]\"."
collect
(cl-loop for pos in record
collect (alist-get pos marker-alist))))
- (`(,regexp . ,pred) (treesit--thing-unpack-pattern
- treesit-defun-type-regexp))
;; Collect positions each function returns.
(positions
(treesit--ert-collect-positions
@@ -929,7 +927,7 @@ and \"]\"."
(if-let ((pos (funcall
#'treesit--navigate-thing
(point) (car conf) (cdr conf)
- regexp pred tactic)))
+ treesit-defun-type-regexp tactic)))
(save-excursion
(goto-char pos)
(funcall treesit-defun-skipper)