Function: treesit-fold--get-fold-range
treesit-fold--get-fold-range is a natively compiled function defined
in treesit-fold.el.
Signature
(treesit-fold--get-fold-range NODE)
Documentation
Return the beginning (as buffer position) of fold for NODE.
Return nil if there is no fold to be made.
Source Code
;; Defined in /nix/store/mpy1l6b4hlzpp59l4vbahq83hqa821ci-emacs-packages-deps/share/emacs/site-lisp/elpa/treesit-fold-0.2.1/treesit-fold.el
(defun treesit-fold--get-fold-range (node)
"Return the beginning (as buffer position) of fold for NODE.
Return nil if there is no fold to be made."
(when-let* ((fold-alist (alist-get major-mode treesit-fold-range-alist))
(fold-func (alist-get (intern (treesit-node-type node)) fold-alist)))
(cond ((functionp fold-func) (funcall fold-func node (cons 0 0)))
((listp fold-func) (funcall (nth 0 fold-func) node (cons (nth 1 fold-func) (nth 2 fold-func))))
(t (user-error "Bad folding function for node")))))