Skip to content

Instantly share code, notes, and snippets.

@ydm
Created May 26, 2023 14:20
Show Gist options
  • Select an option

  • Save ydm/bbc7e15f334108df2d4832b82ed556ff to your computer and use it in GitHub Desktop.

Select an option

Save ydm/bbc7e15f334108df2d4832b82ed556ff to your computer and use it in GitHub Desktop.
(defun describe-treesit-node (node &optional indent)
(setq indent (or indent 0))
(message "%s%s" (make-string (* 2 indent) ? ) node)
(mapcar
(lambda (n) (describe n (1+ indent)))
(treesit-node-children node)))
;; Example
;; (describe (treesit-parse-string "fn f() {
;; let b = '\"';
;; }" 'rust))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment