From: Yuan Fu <casouri@gmail.com>
To: jostein@kjonigsen.net
Cc: 59660@debbugs.gnu.org, theo@thornhill.no
Subject: bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly
Date: Mon, 28 Nov 2022 15:06:30 -0800 [thread overview]
Message-ID: <D5ED9809-DD9A-4EAD-800A-FA466BB5721D@gmail.com> (raw)
In-Reply-To: <ad012e74-57e5-6acd-4766-340813dac0c3@secure.kjonigsen.net>
> On Nov 28, 2022, at 7:04 AM, Jostein Kjønigsen <jostein@secure.kjonigsen.net> wrote:
>
> From: "Jostein Kjønigsen" <jostein@ThinkPad-T14s.mail-host-address-is-not-set>
> To: bug-gnu-emacs@gnu.org
> Subject: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly
> --text follows this line--
>
> --
> When I:
>
> 1. create a typescript file (sample.ts)
> 2. create class and add some methods to it.
>
> I observe that:
>
> - method names are consistently fontified as font-lock-property-face.
>
> I expected that:
>
> - method names to be consistently fontified as font-luck-function-name-face.
>
> This seems to be because of the "property_identifier" is used for
> functions in the treesitter-grammar, and this property is used
> indiscriminately to apply font-lock-property-face at the bottom of the
> major-mode grammar.
>
> This "shadows" the former rules which correctly apply font-lock-function-name-face.
>
> The best would obviously have a way to identify properties more accurately, to precent
> shadowing from taking place. Unfortunately I cannot see a realiable way to do that
> based on the current parse-tree.
>
> Seeing as properties in Typescript are fairly rare while methods are very common,
> it seems appropriate to me to remove the property-specific fontification rules
> to restore the method-fontification rules.
>
> I got a patch for this ready, if people are willing to accept it.
Maybe you can remove the :override flag for the property_identifier rule, so it doesn’t shadow the function rule? Would that work better?
Yuan
next prev parent reply other threads:[~2022-11-28 23:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 15:04 bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly Jostein Kjønigsen
2022-11-28 15:09 ` bug#59660: lisp/progmodes/typescript-ts-mode.el: restore method-name fontification Jostein Kjønigsen
2022-11-28 16:44 ` Jostein Kjønigsen
2022-11-28 16:53 ` Jostein Kjønigsen
2022-11-28 17:08 ` Jostein Kjønigsen
2022-11-28 17:27 ` Eli Zaretskii
2022-11-28 18:00 ` Jostein Kjønigsen
2022-11-28 23:02 ` Yuan Fu
2022-11-28 23:06 ` Yuan Fu [this message]
2022-11-29 12:10 ` bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly Eli Zaretskii
2022-11-29 13:58 ` Jostein Kjønigsen
2022-11-29 14:30 ` Eli Zaretskii
2022-11-29 15:10 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-29 16:35 ` Jostein Kjønigsen
2022-11-29 16:39 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D5ED9809-DD9A-4EAD-800A-FA466BB5721D@gmail.com \
--to=casouri@gmail.com \
--cc=59660@debbugs.gnu.org \
--cc=jostein@kjonigsen.net \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).