From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Theodor Thornhill <theo@thornhill.no>, 73978@debbugs.gnu.org
Subject: bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode
Date: Sat, 9 Nov 2024 08:49:55 -0800 [thread overview]
Message-ID: <1B168B41-6D66-422B-BA5E-17ABE5548353@gmail.com> (raw)
In-Reply-To: <8634k0ojpp.fsf@gnu.org>
> On Nov 9, 2024, at 1:11 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Ping! Theo, can you answer Yuan's questions?
I’ve been using my local fix at work for a while now and it seems to work fine. I’ll make a patch and apply in a few days.
Yuan
>
>> Cc: theo@thornhill.no
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 23 Oct 2024 21:06:40 -0700
>>
>> X-Debbugs-CC: theo@thornhill.no
>>
>> In tsx-ts-mode we use this query to apply syntax properties:
>>
>>
>> (defvar tsx-ts--s-p-query
>> (when (treesit-available-p)
>> (treesit-query-compile 'tsx
>> '(((regex pattern: (regex_pattern) @regexp))
>> ((variable_declarator value: (jsx_element) @jsx))
>> ((assignment_expression right: (jsx_element) @jsx))
>> ((arguments (jsx_element) @jsx))
>> ((parenthesized_expression (jsx_element) @jsx))
>> ((return_statement (jsx_element) @jsx))))))
>>
>>
>> And then in tsx-ts--syntax-propertize-captures we mark everything
>> enclosed by the captured jsx_element nodes in text fences.
>>
>> Then for the following code
>>
>> <button onClick={() => {
>> func();
>> return true;
>> }}>
>> Text
>> {func();}
>> </button>
>>
>> All the func() and other code will be considered text because the whole
>> jsx tag (<button>...</button>) are wrapped in string fences. Theo,
>> what’s the original intention for marking jsx_elements as text? Can we
>> only mark jsx_text as string?
>>
>> Yuan
>>
>>
>>
>>
>>
prev parent reply other threads:[~2024-11-09 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 4:06 bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode Yuan Fu
2024-11-09 9:11 ` Eli Zaretskii
2024-11-09 16:49 ` Yuan Fu [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=1B168B41-6D66-422B-BA5E-17ABE5548353@gmail.com \
--to=casouri@gmail.com \
--cc=73978@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=theo@thornhill.no \
/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.