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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#64647: closed (treesit-query-error due to a recent change to
 tree-sitter-javascript grammar definition)
Date: Sun, 23 Jul 2023 05:18:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 23 Jul 2023 08:17:56 +0300
with message-id <83r0oz6waj.fsf <at> gnu.org>
and subject line Re: bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition
has caused the debbugs.gnu.org bug report #64647,
regarding treesit-query-error due to a recent change to tree-sitter-javascript grammar definition
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
64647: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64647
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: treesit-query-error due to a recent change to tree-sitter-javascript
 grammar definition
Date: Sat, 15 Jul 2023 14:34:29 +0200
[Message part 3 (text/plain, inline)]
Hi, 
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.
Thank you
Vincenzo

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? 

[0001-Updated-JSX-support-due-to-changes-in-tree-sitter-ja.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 64647-done <at> debbugs.gnu.org, v.pupillo <at> gmail.com, jostein <at> kjonigsen.net
Subject: Re: bug#64647: treesit-query-error due to a recent change to
 tree-sitter-javascript grammar definition
Date: Sun, 23 Jul 2023 08:17:56 +0300
> From: Theodor Thornhill <theo <at> thornhill.no>
> Cc: 64647 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
> Date: Sat, 22 Jul 2023 23:22:44 +0200
> 
> Vincenzo Pupillo <v.pupillo <at> gmail.com> writes:
> 
> > The changes were made with two different patches. The one that modifies the 
> > indentation is this one: 
> > https://github.com/tree-sitter/tree-sitter-typescript/commit/
> > b893426b82492e59388a326b824a346d829487e8
> >
> > Thanks.
> > Ciao
> > V.
> 
> Great! Installed and pushed the patches to emacs-29. Thanks, Vincenzo!

Thank you all for a fast and efficient solution.

(The commit needed a small fixup, though.)

Closing the bug.


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.