GNU bug report logs - #59691
29.0.60; typescript-ts-mode: any HTML-like elements causes fontification to become invalid and remaining parse-tree to become jsx-expression

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Tue, 29 Nov 2022 20:04:01 UTC

Severity: normal

Found in version 29.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 59691 <at> debbugs.gnu.org, casouri <at> gmail.com, jostein <at> kjonigsen.net, eliz <at> gnu.org
Subject: bug#59691: Html-like constructs fail in typescript
Date: Tue, 29 Nov 2022 22:37:25 +0100
Nice!

Should we until further notice assume that js-ts-mode suffers from the same issues, and that a jsx-ts-mode might be needed too? To me it at least sounds plausible. 

Speaking of duplication… Now that we have tree-sitter wouldn’t it be possible to use the same parser and/or the same major-modes for JS/JSX as we already do for TS/TSX? JS/JSX is just Typescript without the type-annotations, right?

Or are there good reasons for having separate modes for these?

—
Jostein Kjønigsen
https://jostein.kjønigsen.net

> On 29 Nov 2022, at 22:04, Theodor Thornhill <theo <at> thornhill.no> wrote:
> 
> 
> Hi Jostein!
> 
> I already have a fix for this bug lined up, and will send the fix as
> soon as I get my other stuff applied.  It relies on another patch that
> is waiting.
> 
> The solution is to create two modes: typescript-ts-mode and
> tsx-ts-mode. They have separate parsers, and should be treated as
> separate languages.  That means that in a .ts file we enable the
> 'typescript' language, and in .tsx we enable the 'tsx' language.  This
> exact issue is why they have two languages.
> 
> In other words, we cannot support this in typescript-ts-mode.
> 
> I hope to get this in pretty soon :)
> 
> Theo





This bug report was last modified 2 years and 230 days ago.

Previous Next


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