以 emacs -Q 用 c-ts-mode 打开一个 hello world 的 C 文件会没有语法高亮并有 treesit query 报错。
Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Syntax error at" 93 "((declaration type: (macro_type_specifier name: (identifier) @_name) @for-each-tail) (#match \"FOR_EACH_\\\\(?:ALIST_VALUE\\\\|FRAME\\\\|LIVE_BUFFER\\\\|TAIL\\\\(?:_SAFE\\\\)?\\\\)\" @_name))" "Debug the query with `treesit-query-validate'")
不只是 c-ts-mode,python-ts-mode 也会有类似的报错 treesit-query-error "Syntax error" ...。用 treesit-query-validate debug 对应的 query 就是一样的 Syntax error
emacs 版本是 30.2, 系统 tree-sitter 版本是 0.26.8 。(treesit-library-abi-version) 返回 15,(treesit-language-abi-version 'c) 和 (treesit-language-abi-version 'python) 的返回都是 15。