unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: Theodor Thornhill <theo@thornhill.no>
Cc: 59660@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	jostein@kjonigsen.net, Yuan Fu <casouri@gmail.com>
Subject: bug#59660: 29.0.50; typescript-ts-mode consistently fontifies method-names incorrectly
Date: Tue, 29 Nov 2022 17:35:31 +0100	[thread overview]
Message-ID: <30978023-D3F6-4A5D-B3D2-AF975807A637@secure.kjonigsen.net> (raw)
In-Reply-To: <87h6yhajap.fsf@thornhill.no>



> On 29 Nov 2022, at 16:10, Theodor Thornhill <theo@thornhill.no> wrote:
> 
> Jostein Kjønigsen <jostein@secure.kjonigsen.net> writes:
> 
>> Cc: 59660@debbugs.gnu.org, theo@thornhill.no
>>>> From: Yuan Fu <casouri@gmail.com>
>>>> Date: Mon, 28 Nov 2022 15:06:30 -0800
>>>> 
>>>> Maybe you can remove the :override flag for the property_identifier rule, so it doesn’t shadow the function rule? Would that work better?
>> I plan to test that as quickly as I time permits. If we can make both 
>> behaviours work, that would obviously be the best.
>>> 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?
>> 
>> I honestly think this is reasonably clear.
>> 
>> "Properties" with getters and setters are at this point in time almost 
>> entirely unused in EcmaScript/TypeScript space. They are optional and 
>> have complicated syntax, and don't play well with JSON serialization 
>> (and thus can't be used in REST APIs).
>> 
>> You however cannot write a program without defining or invoking 
>> methods/functions. So not having method-fontification working correctly 
>> will literally impact **all** TypeScript-users.
> 
> Could you give me a code example, Jostein?  I'm just interested in a
> repro, because I can't reproduce it with the typescript-ts-mode.
> 
> I tried using this from [0]:
> ```
> class Greeter {
>  greeting: string;
> 
>  constructor(message: string) {
>    this.greeting = message;
>  }
> 
>  greet() {
>    return "Hello, " + this.greeting;
>  }
> }
> ```
> 
> On my end I get no property-face, just function-name-face.  Both on
> constructor and greet.  I'm not saying I disagree with you, but what am
> I missing?
> 
> Theo
> 
> [0]: https://www.typescriptlang.org/docs/handbook/classes.html
> 

I’ve already submitted patches to fix this which Yuan has pushed. Try going a couple days back in time and try again ;) 

What remains to be decided is what we do with property-highlighting, and if we can find a way to enable that without colliding with function-names. 

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





  reply	other threads:[~2022-11-29 16:35 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
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 [this message]
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=30978023-D3F6-4A5D-B3D2-AF975807A637@secure.kjonigsen.net \
    --to=jostein@secure.kjonigsen.net \
    --cc=59660@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@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).