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


View this message in rfc822 format

From: Daniel Colascione <dancol <at> dancol.org>
To: theo <at> thornhill.no, 73978 <at> debbugs.gnu.org, casouri <at> gmail.com, dmitry <at> gutov.dev
Cc: Eli Zaretskii <eliz <at> gnu.org>, 73978-done <at> debbugs.gnu.org
Subject: bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode
Date: Sun, 05 Jan 2025 09:13:41 -0500

On January 5, 2025 6:55:11 AM EST, "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> wrote:
>Yuan Fu <casouri <at> gmail.com> writes:
>
>>> On Dec 12, 2024, at 9:19 AM, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
>>> 
>>> On 12/12/2024 06:56, Yuan Fu wrote:
>>>> How hard is it to add a new syntax for this case? Or is there some way to work around this? We can’t just not apply the string syntax, because if the “a” is a parenthesis, etc, it would mess up the parenthesis balancing after it.
>>> 
>>> Probably not very hard, but that seems like it'd affect the total set of syntax classes - which means adding it to the manual, etc.
>>> 
>>>> Maybe just give it a whitespace syntax?
>>> 
>>> Right, in such cases I applied the "whitespace" or "punctuation" syntax to the whole character span, like in https://github.com/dgutov/mmm-mode/blob/master/mmm-erb.el#L97
>>
>> Thanks. I went with the whitespace trick and pushed my patch to master.
>>
>> Yuan
>
>FWIW, I believe this is a regression caused by later versions of the
>treesit grammar. What is talked about here was explicitly a goal for me
>to handle at least better than what it appears it has been for some
>time. IIRC they changed what nodes were applied as the jsx nodes quite
>dramatically some time ago. I'm not surprised there are issues after
>that, as most wasn't backward compatible

Hrm.




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.