GNU bug report logs -
#62429
30.0.50; Add jsx faces to typescript-ts-mode
Previous Next
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
> On Mar 25, 2023, at 5:30 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>> Cc: theo <at> thornhill.no
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Fri, 24 Mar 2023 16:49:35 -0700
>>
>> 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?
>
> We never had any mode-specific faces for font-lock, AFAIK. Why is
> this case different? Why not use one of the existing font-lock faces,
> or even add new ones (but not specific to JSX)?
>
> (Adding Stefan.)
IFIAK, css-mode has its own face. These two faces are specific to HTML and not widely applicable to other languages like other font-lock faces do.
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.
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.