Subject: bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode

From: Yuan Fu <[email-masked]>
Date: Sat, 4 Jan 2025 11:58:02 -0800

> On Dec 25, 2024, at 9:37 PM, Dmitry Gutov <[email-masked]> wrote:
> 
> On 25/12/2024 10:33, Yuan Fu wrote:
>>> The patch just demonstrated one of possible ways to solve the problem.
>>> 
>>>> And I still don’t understand the intention of your patch.  Maybe
>>>> I missed something.  Am I correct that you want to apply string syntax
>>>> on the tags, eg, <div>, <button>, </button>, </div>?
>>> I don't need to apply string syntax on the tags.  I just found
>>> that currently C-M-f navigation was broken.  Maybe there are
>>> other ways to fix it?
>> Then let’s look for other ways to solve the problem you demonstrated. Dmitry, would there be any negative effects if we apply the whitespace syntax on all the text (rather than string syntax)? Ah, I guess skip-syntax wouldn’t work right. Is there another way to tell syntax-ppss to skip a chunk of text when scanning?
> 
> Maybe not.
> 
> But I guess tsx-ts--syntax-propertize-captures could only apply syntax to specific characters inside the text - it would search for parens, brackets, (something else?), and put the "punctuation" syntax on them - that should play nicer with sexp/word/symbol navigation.
> 
> A bit more code, but OTOH we would drop the (eq ne (1+ ns)) distinction.

That’s a good idea! I implemented this. Now forward-sexp should work as normal.

Yuan