GNU bug report logs - #64647
treesit-query-error due to a recent change to tree-sitter-javascript grammar definition

Previous Next

Package: emacs;

Reported by: Vincenzo Pupillo <v.pupillo <at> gmail.com>

Date: Sat, 15 Jul 2023 12:35:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 64647 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Jostein Kjonigsen <jostein <at> kjonigsen.net>
Cc: 64647 <at> debbugs.gnu.org
Subject: Re: bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition
Date: Sat, 15 Jul 2023 15:23:17 +0200

On 15 July 2023 14:57:46 CEST, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
>> Date: Sat, 15 Jul 2023 14:34:29 +0200
>> 
>> this commit (bb1f97b643b77fc1f082d621bf533b4b14cf0c30) changed the definition 
>> of the JSX grammar to tree-sitter-javascript. This causes a node type error:
>> "
>> Error while displaying: (jit-lock-function 1) reported (treesit-query-error 
>> "Node type error at" 24 "(jsx_opening_element [(nested_identifier (identifier)) 
>> (identifier)] @font-lock-function-call-face) (jsx_closing_element 
>> [(nested_identifier (identifier)) (identifier)] @font- lock-function-call-face) 
>> (jsx_self_closing_element [(nested_identifier (identifier)) (identifier)] @font-
>> lock-function-call-face) (jsx_attribute (property_identifier) @font-lock-
>> constant-face)" "Debug the query with `treesit-query-validate'")
>> "
>> Indentation also has problems due to the deletion of "jsx_fragment" definition.
>> 
>> The patch in attachment fixes both problems.
>
>Will the patch work with the grammar libraries before the recent
>change?
>
>> p.s. nvim-treesitter tries to limit these problems by indicating which commit 
>> to install. Does it make sense to try a similar approach with emacs as well? 
>
>I think it is better if we make the code work with as many versions as
>possible, by checking whether a feature exists before using it.
>
>Theo, Jostein: any comments or ideas?
>
>Thanks.

I'll look into it tonight - thanks for the heads up!

Theo




This bug report was last modified 2 years and 17 days ago.

Previous Next


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