GNU bug report logs -
#64830
29.1; C++ treesitter mode no coloration
Previous Next
Reported by: David Come <david.come <at> ageagle.com>
Date: Mon, 24 Jul 2023 10:34:01 UTC
Severity: normal
Merged with 64818
Found in versions 29.1, 30.0.50
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #22 received at 64830 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 16 Aug 2024 16:44:33 +0000
> Cc: Yuan Fu <casouri <at> gmail.com>, 64830 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm <at> muc.de>
>
> Create the file ~/class-3.cc with the following contents:
> /////////////////////////////////////////////////////////////////////////
> // foo
> class A
> {
> struct B {
> int i;
> };
> struct B {
> int i;
> };
> };
> /////////////////////////////////////////////////////////////////////////
>
> (i) emacs -Q
> (ii) M-x load-library <RET> c-ts-mode <RET>
> (iii) C-x C-f ~/class-3.cc <RET>
>
> The buffer, in c++-ts-mode, has no fontification apart from the comment
> on its first line.
>
> > If this happens with any file and in 'emacs -Q", do you see redisplay
> > error messages in *Messages*? If so, what are those messages?
>
> Yes, I see a single message after the above recipe. It's:
>
> 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'")
>
> > > I think I'm using tree-sitter-cpp version 0.22.2 as downloaded from the
> > > Gentoo repository. Is there an easy way to check this from inside
> > > Emacs?
>
> > No, not AFAIK. And the problem is not the version of tree-sitter, it
> > is usually the version of the C++ grammar library. Do you know the
> > version of that one you have installed?
>
> I have libtree-sitter-cpp.so.0.14, built and installed on 2024-08-04.
> The package is (confusingly) called dev-libs/tree-sitter-cpp-0.22.2.
I can reproduce this in Emacs 29, but not in the current emacs-30
branch. I think I also have libtree-sitter-cpp version 0.22.2, but I
also tested with 0.22.3 and I see no problem there, either (with Emacs
30). So I wonder why you see this in Emacs 30.
This bug report was last modified 255 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.