Subject: Re: bug#64830: 30.0.50 C++ treesitter mode no coloration

From: Alan Mackenzie <[email-masked]>
Date: Sun, 25 Aug 2024 12:08:33 +0000

Hello, Eli.

On Sun, Aug 25, 2024 at 07:54:43 +0300, Eli Zaretskii wrote:
> > Date: Sun, 25 Aug 2024 02:19:28 +0000
> > Cc: Eli Zaretskii <[email-masked]>, [email-masked]
> > From: Alan Mackenzie <[email-masked]>

> > I've now applied your patch, the one whose first hunk's header is:

> > @@ -537,6 +537,16 @@ c-ts-mode--top-level-label-matcher

> > , but it unfortunately doesn't solve the bug.  On templates-21.cc, one of
> > the test files from CC Mode, on doing M-x c++-ts-mode, there is no
> > fontification at all.  In *Messages* we have

> > Error during redisplay: (jit-lock-function 1) signaled
> > (treesit-query-error "Node type error at" 677 "[\"_Atomic\" \"break\"
> > \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\"
> > \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" \"restrict\"
> > \"return\" \"sizeof\" \"static\" \"struct\" \"switch\" \"typedef\"
> > \"union\" \"volatile\" \"while\" \"and\" \"and_eq\" \"bitand\" \"bitor\"
> > \"catch\" \"class\" \"co_await\" \"co_return\" \"co_yield\" \"compl\"
> > \"concept\" \"consteval\" \"constexpr\" \"constinit\" \"decltype\"
> > \"delete\" \"explicit\" \"final\" \"friend\" \"mutable\" \"namespace\"
> > \"new\" \"noexcept\" \"not\" \"not_eq\" \"operator\" \"or\" \"or_eq\"
> > \"override\" \"private\" \"protected\" \"public\" \"requires\"
> > \"template\" \"throw\" \"try\" \"typename\" \"using\" \"xor\" \"xor_eq\"]
> > @font-lock-keyword-face (auto) @font-lock-keyword-face (this)
> > @font-lock-keyword-face (virtual) @font-lock-keyword-face" "Debug the
> > query with `treesit-query-validate'")

> > That "Node type error at" 677 isn't a buffer position - the buffer is
> > only 325 characters long.

> > Is there anything else I could do to help, here?

> AFAIR, you still didn't respond to my questions about the version of
> the C++ grammar library you are using, nor tried to upgrade to the
> latest version of that grammar library.

I thought I said that right at the beginning, in my first post on this
thread.  I'm using tree-sitter-cpp version 0.22.2, and version 0.22.6 of
tree-sitter itself.

> FTR, I'm using tree-sitter version 0.20.8 and grammar library from
> their Git repository as of June 17 (this is version 0.22.2 of the
> grammar library with a couple of changes after that version).  I have
> no problems with displaying C++ files whatsoever, and *Messages* is
> clean.  I also tried the latest version of the grammar library
> (0.22.3), and didn't see any problems there, either.

I haven't been able to find a download facility on the tree-sitter-cpp
page at Github.  Did you download a ready built version of
tree-sitter-cpp 0.22.3, or did you have to build it yourself from
sources?

-- 
Alan Mackenzie (Nuremberg, Germany).