GNU bug report logs - #62429
30.0.50; Add jsx faces to typescript-ts-mode

Previous Next

Package: emacs;

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

Date: Fri, 24 Mar 2023 23:51:02 UTC

Severity: normal

Found in version 30.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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <casouri <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#62429: closed (30.0.50; Add jsx faces to typescript-ts-mode)
Date: Thu, 30 Mar 2023 08:13:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 30 Mar 2023 01:11:48 -0700
with message-id <FF2FDBE4-94AA-4E97-9EBC-301994B9D655 <at> gmail.com>
and subject line Re: bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode
has caused the debbugs.gnu.org bug report #62429,
regarding 30.0.50; Add jsx faces to typescript-ts-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
62429: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62429
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Bug Report Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.50; Add jsx faces to typescript-ts-mode
Date: Fri, 24 Mar 2023 16:49:35 -0700
[Message part 3 (text/plain, inline)]
X-Debbugs-CC: theo <at> thornhill.no

Hey Theo, I want to add separate faces for JSX tags and attributes.
Otherwise users will be in a world of pain if they want to use different
fontification for JSX tag and funcall, and JSX attribute and constant. WDYT?

Yuan

[faces.patch (application/octet-stream, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: theodor thornhill <theo <at> thornhill.no>, 62429-done <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#62429: 30.0.50; Add jsx faces to typescript-ts-mode
Date: Thu, 30 Mar 2023 01:11:48 -0700

> On Mar 29, 2023, at 10:25 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Wed, 29 Mar 2023 17:28:40 -0700
>> Cc: monnier <at> iro.umontreal.ca,
>> 62429 <at> debbugs.gnu.org,
>> theo <at> thornhill.no
>> 
>>>> JSX is basically HTML mixed with Javascript, so JSX tags and attributes are just HTML tags and attributes. Normally it’s fine to just use some semi-related font-lock face for them; mhtml.el uses function-call-face and constant-face for tags and attributes. But because in JSX, HTML tags and attribtues appear in the same buffer with Javascript code, if we use function-call-face and constant-face for tags and attributes, it’s impossible to change their appearance and not affect the functions and constants in Javascript code, because we are using the same face for JS functions and HTML tags, and JS constants and HTML attributes.
>>> 
>>> OK, but then how will these JSX-specific faces fit into the overall
>>> scheme of treesit-font-lock faces?  For example, in what level will
>>> they be used, and how will users know what level to set to see these
>>> faces in their buffers?
>> 
>> At level 3 for tsx-ts-mode, under the “jsx” feature. So they are enabled by default. Though it’s true that it’s not immediately obvious what face to customize. At the very least these faces appear in the customize group of typescript. We can add something to the docstring of the major mode, too.
>> 
>>> 
>>> These are the downsides of mode-specific faces, and if we think it's
>>> important enough to have them, we should resolve these issues when we
>>> install such faces.
> 
> Then it is fine by me, as long as those measures you mentioned are
> taken to make sure users know how to customize font-lock with these
> faces.

Cool. I pushed the change.

Yuan

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

Previous Next


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