bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dmitry Gutov
Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Thu, 4 May 2023 00:58:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 02/05/2023 03:29, Randy Taylor wrote:
On Friday, April 28th, 2023 at 06:05, Dmitry Gutov <dmitry@gutov.dev> wrote:
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.

Sorry, I was operating under false assumptions and somehow convinced myself 
that treesit-query-string with an empty string returning nil meant the query 
wasn't supported, hence me thinking it achieved nothing. I am no longer under 
such delusions :).


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.

Good point. I've attached a patch using treesit-query-string with an empty 
string. It now works properly when iota is missing but inserted later.

Thanks! I've pushed this to emacs-29, so the bug can be closed.

Stylistically, I think I prefer the original way (with condition-case), but we'll have plenty of time to refine this on master later.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]