From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: 59660@debbugs.gnu.org, jostein@kjonigsen.net, theo@thornhill.no
Subject: bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly
Date: Tue, 29 Nov 2022 14:10:19 +0200 [thread overview]
Message-ID: <83k03em05w.fsf@gnu.org> (raw)
In-Reply-To: <D5ED9809-DD9A-4EAD-800A-FA466BB5721D@gmail.com> (message from Yuan Fu on Mon, 28 Nov 2022 15:06:30 -0800)
> Cc: 59660@debbugs.gnu.org, theo@thornhill.no
> From: Yuan Fu <casouri@gmail.com>
> Date: Mon, 28 Nov 2022 15:06:30 -0800
>
> > 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?
This could be a personal preference, perhaps? It isn't clear to me that
only one of the two is definitely correct. So maybe we need a user option
for which one overrides which?
next prev parent reply other threads:[~2022-11-29 12:10 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 ` bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly Yuan Fu
2022-11-29 12:10 ` Eli Zaretskii [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83k03em05w.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=59660@debbugs.gnu.org \
--cc=casouri@gmail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.