Closed anderso closed 8 months ago
Thanks for raising that. Could be your libtreesitter that's old; your grammar that's old (or really new!) and that's causing it. I'll investigate.
It might be because they are new, this is my emacs version:
GNU Emacs 29.2 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-01-27
and the grammar should be from git master as of yesterday.
Thanks, I'll have a look. They are stupidly not versioned at all, and the query engine throws a hissyfit if it encounters a node type it does not know.
It is indeed caused by updates in the grammar(s) because changing from master to v0.20.3, ie:
(setq treesit-language-source-alist
'((tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "v0.20.3" "tsx/src"))
(typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "v0.20.3" "typescript/src"))))
and reinstalling makes the error go away. And it seems they have actually started tagging versions: https://github.com/tree-sitter/tree-sitter-typescript/releases
Thanks for investigating.
Today I ran into what I believe is the same issue; I pulled Combobulate from the development
branch and I got roughly the same warning, except with 66 instead of 85:
⛔ Warning (emacs): Query ((arrow_function body:
((_ (sequence_expression left: (_) @combobulate-query-highlight-vibrant-veggie-face))))) failed to compile: (66 . Structure error at).
After some debugging and source-code reading, I am able to provide a smaller reproduction case: evaluating
(treesit-query-capture 'tsx "((arrow_function body:\n ((_ (sequence_expression left: (_) @combobulate-query-highlight-vibrant-veggie-face)))))")
produces the following error,
progn: Query pattern is malformed: "Structure error at", 66, "((arrow_function body:
((_ (sequence_expression left: (_) @combobulate-query-highlight-vibrant-veggie-face)))))", "Debug the query with `treesit-query-validate'"
Indeed, commenting out line 266 of combobulate-js-ts.el
, that reads
((arrow_function body: ((_ (sequence_expression left: (_) @hl.veggie)))))
makes the warning go away.
Yeah you need to use an older, tagged, release of TSX -- it's rather annoying. I'll have to build something into combobulate to test if queries are valid.
Yeah you need to use an older, tagged, release of TSX -- it's rather annoying. I'll have to build something into combobulate to test if queries are valid.
Got it, what are your thoughts on https://github.com/mickeynp/combobulate/pull/81 ?
Should be fixed in Combobulate master. Note that you must now keep your grammar consistent with what Combobulate/Emacs expects
Whenever i enable combobulate-mode in a typescript-ts-mode buffer, the Warnings buffer is displayed with this message:
combobulate seems to work fine though.