mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-18 16:06:56 -05:00
feat(tree-sitter): add +tree-sitter/doctor command
For a quick diagnosis of the state of tree-sitter support in the current buffer.
This commit is contained in:
@@ -75,6 +75,9 @@ requires two additional steps:
|
||||
version constraints; newer versions of some grammars may not work with older
|
||||
versions of Emacs).
|
||||
|
||||
To test whether tree-sitter is functioning in the current buffer, execute ~M-x
|
||||
+tree-sitter/doctor~.
|
||||
|
||||
* TODO Usage
|
||||
#+begin_quote
|
||||
/This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
||||
|
@@ -69,6 +69,14 @@ pre-Emacs 31."
|
||||
(let (auto-mode-alist interpreter-mode-alist)
|
||||
(apply fn args)))
|
||||
|
||||
;;; TODO: Backwards compatibility
|
||||
;;;###autoload
|
||||
(defun +tree-sitter/doctor ()
|
||||
"Test if the current buffer is correctly tree-sitter-enabled."
|
||||
(interactive)
|
||||
(unless (treesit-available-p)
|
||||
(user-error "This Emacs install wasn't built with treesit support!"))
|
||||
(unless (treesit-parser-list)
|
||||
(user-error "No tree-sitter parsers are active in this buffer; are the grammars properly installed?"))
|
||||
(message "Tree-sitter is functioning in this buffer!"))
|
||||
|
||||
;;; tree-sitter.el ends here
|
||||
|
Reference in New Issue
Block a user