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

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

bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parent


From: Dmitry Gutov
Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching
Date: Sat, 26 Aug 2023 04:52:35 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Augustin!

On 25/08/2023 10:17, Augustin Chéneau (BTuin) wrote:
Thanks for the patch, but I still have some issues. I believe that the
START and END arguments of `put-text-property` are off by one. The
attached modified patch seems to work better.

Thanks for trying it out. Sorry about missing your first patch: apparently while it was the first time-wise, it was help up in moderation.

Anyway, you make a good point about the case with the regexp: since I matched the pattern inside, the bounds of the node are off by one compared to the case with the jsx node. Your patch moves those bounds, but then they'll be wrong for the latter case.

Here's an update which tries to handle both, but I guess if we add more node types later we'll just have to stop trying to handle them the same way (and do it closer to ruby-ts--syntax-propertize).

Also added the new return_statement case for jsx.

Attachment: js-ts--syntax-propertize-v2.diff
Description: Text Data


reply via email to

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