Subject: Re: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock

From: Dmitry Gutov <[email-masked]>
Date: Fri, 28 Apr 2023 13:05:51 +0300

On 28/04/2023 04:35, Randy Taylor wrote:
> Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in?

It would return nil, not error (querying an empty buffer). And we should 
be checking for error.

This is the part that java-ts-mode--string-highlight-helper got right, BTW.

go-ts-mode--iota-query-supported-p in your patch relies on the condition 
that the file, at the time the mode is enabled, already contains at 
least one "iota" node.

> In that case, wouldn't using treesit-query-capture directly be the best? I don't understand why it's not from reading that thread. If it isn't, then treesit-query-validate is the only option, right?

treesit-query-validate pops a new buffer interactively in the case of 
failure, so it's not something we should use here.