Function: treesit--top-level-thing
treesit--top-level-thing is a byte-compiled function defined in
treesit.el.gz.
Signature
(treesit--top-level-thing NODE REGEXP &optional PRED)
Documentation
Return the top-level parent thing of NODE.
REGEXP and PRED are the same as in treesit-thing-at-point.
Source Code
;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit--top-level-thing (node regexp &optional pred)
"Return the top-level parent thing of NODE.
REGEXP and PRED are the same as in `treesit-thing-at-point'."
(treesit-node-top-level
node (lambda (node)
(and (string-match-p regexp (treesit-node-type node))
(or (null pred) (funcall pred node))))
t))