From: Yuan Fu <casouri@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>, JD Smith <jdtsmith@gmail.com>,
Eli Zaretskii <eliz@gnu.org>
Cc: 67262@debbugs.gnu.org
Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sun, 26 Nov 2023 15:43:22 -0800 [thread overview]
Message-ID: <e4fd3420-8715-4bbc-ab33-7f3235fea564@gmail.com> (raw)
In-Reply-To: <ec6230a6-38dc-02cf-3a8f-9dafda4a8ab7@gutov.dev>
On 11/26/23 6:58 AM, Dmitry Gutov wrote:
> On 26/11/2023 04:04, Dmitry Gutov wrote:
>> As for what to do about this one -- probably something involving
>> syntax-propertize-extend-region-functions, adding an entry which
>> would initialize the parser, but not call syntax-ppss-flush-cache
>> directly (or at least not just that). It would signal the earlier
>> position to extend to through some dynamic variable. This is getting
>> tricky enough to move from the individual major modes into treesit.el
>> proper, I think.
>
> Alternatively, we'd trigger updates eagerly from within
> treesit_record_change -- that would make it slower, invalidating the
> comment above it. Not sure by how much, though.
It seems to me that what we need is to force a re-parse at the beginning
of syntax-propertize or in syntax-ppss-flush-cache; the re-parse would
cause the notifier to run, which runs python--treesit-parser-after-change.
I'm not quite sure about how do we cause this re-parse. The
straightforward approach would be calling treesit-force-reparse[1] in
syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to keep
tree-sitter transparent for syntax.el. Maybe we can add a hook in
syntax-propertize/syntax-ppss-flush-cache.
[1] This function doesn't exist yet, but it's easy to define in lisp.
Yuan
next prev parent reply other threads:[~2023-11-26 23:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 15:52 bug#67262: python-ts-mode cannot identify triple-quoted-strings JD Smith
2023-11-18 16:29 ` Eli Zaretskii
2023-11-18 17:18 ` JD Smith
2023-11-18 22:52 ` Dmitry Gutov
2023-11-25 10:01 ` Eli Zaretskii
2023-11-25 14:42 ` JD Smith
2023-11-26 2:04 ` Dmitry Gutov
2023-11-26 14:58 ` Dmitry Gutov
2023-11-26 23:43 ` Yuan Fu [this message]
2023-11-27 0:05 ` Dmitry Gutov
2023-12-12 8:32 ` Yuan Fu
2023-12-12 21:55 ` Dmitry Gutov
2023-12-16 12:47 ` Eli Zaretskii
2023-12-16 13:37 ` Dmitry Gutov
2023-12-16 13:59 ` Eli Zaretskii
2023-12-16 15:11 ` JD Smith
2023-12-16 15:21 ` Dmitry Gutov
2023-12-16 15:57 ` Eli Zaretskii
2023-12-16 23:36 ` Yuan Fu
2023-12-17 13:46 ` Dmitry Gutov
2023-12-23 9:52 ` Eli Zaretskii
2023-12-23 18:03 ` Yuan Fu
2023-12-23 21:01 ` Dmitry Gutov
2023-12-23 23:51 ` Yuan Fu
2023-12-24 0:45 ` Dmitry Gutov
2023-12-24 3:10 ` Yuan Fu
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=e4fd3420-8715-4bbc-ab33-7f3235fea564@gmail.com \
--to=casouri@gmail.com \
--cc=67262@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=eliz@gnu.org \
--cc=jdtsmith@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).