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: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 64647 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
Subject: bug#64647: Re: bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition
Date: Sun, 16 Jul 2023 20:56:15 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
>> Cc: 64647 <at> debbugs.gnu.org, jostein <at> kjonigsen.net
>> Date: Sun, 16 Jul 2023 20:00:43 +0200
>> 
>> In my patch for java-ts-mode I used treesit-query-capture to figure out whether 
>> a symbol was defined or not. Check out the java-ts-mode--string-highlight-
>> helper function.
>
> Can you do something similar in this case?  That would be good enough
> for Emacs 29.1.
>
>> > Vincenzo, do you want to add compat-code to emacs-29 and your patches?
>> 
>> Okay. I think I can do it this week. Do I create a new file, like treesitter-
>> compat.el ?
>
> This should be for master, I think.  I'd like to release Emacs 29.1
> soon, so this more general job should be less urgent than fixing the
> typescript modes to work with the latest grammars.
>
> Thanks.

Yeah, I was thinking maybe we could just have a check in the major-mode
init, and appending the appropriate nodes into the
treesit-simple-indent-rules there, rather than in the variable
itself. That way we can avoid performance regressions in the indentation
code. That would mean to extract the nodes you changed in your current
patches, maybe add them to a new variable with a name of your choosing,
and conditionally add either-or when the mode inits. Does that make sense?

Thanks,
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.