From 78068a8f31bf684a0c642bc8b1aa501b0f858e36 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 3 Sep 2025 16:28:45 +0200 Subject: [PATCH] fix(tree-sitter): more verbosity in debug mode And slightly better logged message if the grammar is missing. --- modules/tools/tree-sitter/config.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/tools/tree-sitter/config.el b/modules/tools/tree-sitter/config.el index 2e7b2e166..beb623310 100644 --- a/modules/tools/tree-sitter/config.el +++ b/modules/tools/tree-sitter/config.el @@ -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)