Variable: treesit-inspect-mode
treesit-inspect-mode is a buffer-local variable defined in
treesit.el.gz.
Documentation
Non-nil if Treesit-Inspect mode is enabled.
Use the command treesit-inspect-mode(var)/treesit-inspect-mode(fun) to change this variable.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(define-minor-mode treesit-inspect-mode
"Minor mode that displays in the mode-line the node which starts at point.
When this mode is enabled, the mode-line displays
PARENT FIELD-NAME: (NODE FIELD-NAME: (CHILD (...)))
where NODE, CHILD, etc, are nodes which begin at point. PARENT
is the parent of NODE. NODE is displayed in bold typeface.
FIELD-NAMEs are field names of NODE and CHILD, etc (see Info
node `(elisp)Language Grammar', heading \"Field names\").
If no node starts at point, i.e., point is in the middle of a
node, then the mode line displays the earliest node that spans point,
and its immediate parent.
This minor mode doesn't create parsers on its own. It uses the first
parser in `treesit-parser-list'."
:lighter nil
(if treesit-inspect-mode
(progn
(add-hook 'post-command-hook
#'treesit-inspect-node-at-point 0 t)
(add-to-list 'mode-line-misc-info
'(:eval treesit--inspect-name)))
(remove-hook 'post-command-hook
#'treesit-inspect-node-at-point t)
(setq mode-line-misc-info
(remove '(:eval treesit--inspect-name)
mode-line-misc-info))))