From: Dmitry Gutov <dmitry@gutov.dev>
To: Randy Taylor <dev@rjt.dev>
Cc: Eli Zaretskii <eliz@gnu.org>,
63086-done@debbugs.gnu.org, casouri@gmail.com,
Jimmy Wong <wyuenho@gmail.com>
Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock
Date: Thu, 4 May 2023 00:58:22 +0300 [thread overview]
Message-ID: <c27d1a02-5a0f-cb3f-42b4-1a3a0ba58678@gutov.dev> (raw)
In-Reply-To: <rZAjDGFLwSfFTiROkh5YIfTsXZNiykanwOSaIBZQ57jK0XOH4kW6QB_ayBMJAnuhd4AUYv5k5p19SxvLuoWa88FL9iLYOzdYpGhwJEU4Xjc=@rjt.dev>
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.
prev parent reply other threads:[~2023-05-03 21:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 10:00 bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock Jimmy Yuen Ho Wong
2023-04-26 10:36 ` Eli Zaretskii
2023-04-26 11:07 ` Jimmy Wong
2023-04-26 12:38 ` Randy Taylor
2023-04-26 13:26 ` Jimmy Wong
2023-04-26 13:38 ` Eli Zaretskii
2023-04-26 13:44 ` Jimmy Wong
2023-04-26 14:05 ` Randy Taylor
2023-04-26 15:40 ` Randy Taylor
2023-04-27 6:36 ` Jimmy Wong
2023-04-28 0:16 ` Dmitry Gutov
2023-04-28 1:35 ` Randy Taylor
2023-04-28 10:05 ` Dmitry Gutov
2023-05-02 0:29 ` Randy Taylor
2023-05-03 21:58 ` Dmitry Gutov [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c27d1a02-5a0f-cb3f-42b4-1a3a0ba58678@gutov.dev \
--to=dmitry@gutov.dev \
--cc=63086-done@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=dev@rjt.dev \
--cc=eliz@gnu.org \
--cc=wyuenho@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.