GNU bug report logs - #73978
31.0.50; Text syntax applied on too many things in tsx-ts-mode

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Thu, 24 Oct 2024 04:08:02 UTC

Severity: normal

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #70 received at 73978 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Theodor Thornhill <theo <at> thornhill.no>, 73978 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#73978: 31.0.50; Text syntax applied on too many things in
 tsx-ts-mode
Date: Sat, 4 Jan 2025 11:58:02 -0800

> On Dec 25, 2024, at 9:37 PM, Dmitry Gutov <dmitry <at> gutov.dev> 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



This bug report was last modified 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.