fix(tree-sitter): more verbosity in debug mode

And slightly better logged message if the grammar is missing.
This commit is contained in:
Henrik Lissner
2025-09-03 16:28:45 +02:00
parent 87d572ac58
commit 78068a8f31

View File

@@ -60,7 +60,9 @@
;; `treesit-ready-p' calls in Emacs <=30.1. We'll
;; log it to *Messages* instead.
(warning-suppress-types
(cons '(treesit) warning-suppress-types)))
(if doom-debug-mode
warning-suppress-types
(cons '(treesit) warning-suppress-types))))
(or (not (autoloadp fn))
;; ts-modes usually change these alists at autoload
;; *and* load time.
@@ -84,7 +86,9 @@
(format "Missing tree-sitter grammars: %s\nInstall now?"
(mapconcat #'symbol-name grammars ", ")))))
(mapc #'treesit-install-language-grammar grammars)
(message "Aborted installing missing grammars...")
(message "Treesit grammars missing (%s), falling back to `%s'..."
(mapconcat #'symbol-name grammars ", ")
fallback-mode)
nil)
t)))
(put mode '+tree-sitter-ensured t)