GNU bug report logs - #77914
31.0.50; treesit-font-lock-level set to 4 cause rust-ts-mode lost all color

Previous Next

Package: emacs;

Reported by: Eval Exec <execvy <at> gmail.com>

Date: Sat, 19 Apr 2025 05:12:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Eval Exec <execvy <at> gmail.com>
Cc: v.pupillo <at> gmail.com, 77914 <at> debbugs.gnu.org
Subject: bug#77914: 31.0.50; treesit-font-lock-level set to 4 cause rust-ts-mode lost all color
Date: Tue, 22 Apr 2025 21:30:04 +0300
> To reproduce this: use this rust file:
>
> Then eval:
> 1. (progn  (setq treesit-font-lock-level 4) (revert-buffer))
> all color are lost.
>
> 2. (progn  (setq treesit-font-lock-level 3) (revert-buffer))
> colors are good. !Important, level 3 is good, but level 4 lost colors.
>
> 3. (progn  (setq treesit-font-lock-level 4) (revert-buffer))
> all color are lost again.

The treesit-font-lock-level 4 contains the symbol 'error',
therefore it adds highlighting of the ERROR nodes.
At level 3 there are still errors, but whey are not highlighted.
Removing the macro removes the errors.

So if you are sure that the file is correct,
you can report the issue to the authors of
https://github.com/tree-sitter/tree-sitter-rust

Then they can answer why everything in the first macro
is the error:

  (ERROR
   (ERROR (identifier))
   (identifier) {
   (ERROR ( $ ()
   (attribute_item # [
    (ERROR $ ()
    (attribute (metavariable))
    (ERROR : tt ) *)
    ])
   (ERROR ) * (metavariable) : ident)
   (identifier)
   (ERROR $ ( { $ ( (metavariable) :
    (try_expression (identifier)
     (ERROR ) * } ))
     ?)
    (metavariable) : (identifier)
    (ERROR $)
    (
    (ERROR , $)
    ( (metavariable))
   :
   (ERROR
    (try_expression (identifier)
     (ERROR ) * ))
     ?)
    ) => { $)




This bug report was last modified 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.