unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Vincenzo Pupillo <v.pupillo@gmail.com>, 61913@debbugs.gnu.org
Subject: bug#61913: java-ts-mode query error for string highlight, due  to recent commit in tree-sitter-java.
Date: Sat, 4 Mar 2023 01:27:29 -0800	[thread overview]
Message-ID: <7F86A486-0C53-4649-8373-91E093A67A19@gmail.com> (raw)
In-Reply-To: <83h6v1at5y.fsf@gnu.org>



> On Mar 3, 2023, at 11:10 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 3 Mar 2023 14:32:02 -0800
>> Cc: Eli Zaretskii <eliz@gnu.org>,
>> 61913@debbugs.gnu.org
>> 
>>>>> Error during redeployment: (jit-lock-function 8295) reported
>>>>> (treesit-query-error "Node type error at" 42 "(string_literal)
>>>>> @font-lock-string-face (text_block) @font-lock-string-face"
>>>>> "Debugging the query with `treesit-query-validate'")
>>>>> 
>>>>> 
>>>>> The attached patch fixes the problem. 
>>>> 
>>>> Wouldn't removing text_block from our code cause problems if someone
>>>> uses tree-sitter-java from before the removal?
>>>> 
>>>> Is there a way to write code which handles text_block if it exists?
>>>> 
>> 
>> Tree-sitter language grammars really need some versioning system. I
>> wonder how do we propose such things to them tho...
> 
> That'd be hard, given that many of them don't even make releases.
> 
> It should be enough for our purposes to have a possibility of querying
> the grammar about support for specific features.  Then the version
> will not matter, only the supported features will.  Maybe we could do
> that ourselves, on-the-fly, like we do with programs when we want to
> know whether they support some command-line switch?

We can test whether a node type exists in the grammar, by trying to compile a query using that node type. If it returns successfully, then the node type exists. But there are other assumptions we make about a grammar, like “the 2nd child of a if node must be the condition”. Hopefully these more subtle things don’t change easily, because we can’t easily test them.

Yuan






  reply	other threads:[~2023-03-04  9:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 12:21 bug#61913: java-ts-mode query error for string highlight, due to recent commit in tree-sitter-java Vincenzo Pupillo
2023-03-02 12:51 ` Vincenzo Pupillo
2023-03-02 13:01 ` Eli Zaretskii
2023-03-02 16:18   ` Vincenzo Pupillo
2023-03-03 22:32 ` Yuan Fu
2023-03-04  7:10   ` Eli Zaretskii
2023-03-04  9:27     ` Yuan Fu [this message]
2023-03-05 13:50       ` Vincenzo Pupillo
2023-03-05 15:09         ` Eli Zaretskii
2023-03-06  6:12           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-06 14:03             ` Vincenzo Pupillo
2023-03-09 10:24               ` Eli Zaretskii
2023-03-09 12:49                 ` Vincenzo Pupillo
2023-03-09 15:28                   ` Eli Zaretskii
2023-03-09 16:16               ` Dmitry Gutov
2023-03-09 16:49                 ` Vincenzo Pupillo
2023-03-09 17:08                   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7F86A486-0C53-4649-8373-91E093A67A19@gmail.com \
    --to=casouri@gmail.com \
    --cc=61913@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=v.pupillo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).