From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59831: 29.0.60; typescript-ts-mode: Variables, properties & fields are often not fontified Date: Wed, 07 Dec 2022 10:33:29 +0100 Message-ID: <87mt7zzhg6.fsf@thornhill.no> References: <676d4e95-dfe3-5ced-60a3-b2387512ee63@secure.kjonigsen.net> <87v8mqxmfo.fsf@thornhill.no> <2151efc1-b6f6-4e0d-7416-cccae9277a34@secure.kjonigsen.net> <87bkoifbj3.fsf@thornhill.no> <848e54b0-4b74-2d85-064d-bf8dc792d1e8@secure.kjonigsen.net> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27708"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59831@debbugs.gnu.org To: jostein@kjonigsen.net, Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 07 10:34:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2qod-00070B-OV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Dec 2022 10:34:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2qoW-0001lJ-TQ; Wed, 07 Dec 2022 04:34:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2qoU-0001iq-G3 for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 04:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2qoU-0007kl-4f for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 04:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2qoU-0001VQ-0c for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 04:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Dec 2022 09:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59831 X-GNU-PR-Package: emacs Original-Received: via spool by 59831-submit@debbugs.gnu.org id=B59831.16704056165782 (code B ref 59831); Wed, 07 Dec 2022 09:34:01 +0000 Original-Received: (at 59831) by debbugs.gnu.org; 7 Dec 2022 09:33:36 +0000 Original-Received: from localhost ([127.0.0.1]:48831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2qo3-0001VC-Lm for submit@debbugs.gnu.org; Wed, 07 Dec 2022 04:33:36 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:24442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2qo1-0001V6-Jb for 59831@debbugs.gnu.org; Wed, 07 Dec 2022 04:33:35 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670405611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g1qceIBsGnO1eL2MkHtjEZKI/MfCRliA9b9lfvtamQg=; b=HdMNz3y+3HtEcSDng2qsVfMBaF8ieXGMfJMyXIMqaY1/yplV8eqnxnaS0+KkkGaBQsggD9 /39wgPfvucCTA5lMF35EWxs3ZHX91QD5Jro4uMwVTvYRCtfSB1xO3kPJMHyT8Cfe6e4R49 9+teET1QNAOPVy0u/3R3TnQ9fS1JrXhOlKjN5vAaEVwO9OfkzSviDoeSkTpczsm7/bdVJR /91xtGwkvmNiz6zavVrkEAxe/34fvvw3xYCshj1/yiBdAlFPQg84CAGRxqfRdOc6ilGKMP hJgs+k8OmiT8mRzI1IGQPcMqfc4Orov9tBvEzfQhj4Sc90wmFtolreSPxy3NDQ== In-Reply-To: <848e54b0-4b74-2d85-064d-bf8dc792d1e8@secure.kjonigsen.net> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250171 Archived-At: Jostein Kj=C3=B8nigsen writes: > Hey everyone. > > I'd like to add one more change to this particular bug, which makes=20 > fontification of variables more consistent when used in other=20 > expressions and statements. > > Please see attached patch. > > In short this patch changes the following: > > * fontifies property-access in general expressions > * fontifies variables and property-access in if-expressions > > -- > Jostein > > On 05.12.2022 21:13, Yuan Fu wrote: >> >>> On Dec 5, 2022, at 1:24 AM, Theodor Thornhill via Bug reports for GNU E= macs, the Swiss army knife of text editors wrote: >>> >>> Jostein Kj=C3=B8nigsen writes: >>> >>>> Attached is another patch with some further improvements. >>>> >>>> These too OK with you, Theodor? >>>> >>> Yep! >> I squashed the two commits and applied them, Thanks! >> >> Yuan > From 0817a9a9ce00bf44e6368a3d74262f83e49ebbf3 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D > Date: Wed, 7 Dec 2022 09:27:42 +0100 > Subject: [PATCH] lisp/progmodes/typescript-ts-mode.el: Improve fontificat= ion > of variables > > --- > lisp/progmodes/typescript-ts-mode.el | 43 +++++++++++++++++----------- > 1 file changed, 27 insertions(+), 16 deletions(-) > > diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typesc= ript-ts-mode.el > index 3da690567e2..33f332d66d6 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -220,7 +220,32 @@ typescript-ts-mode--font-lock-settings > (binary_expression left: (identifier) @font-lock-variable-name-face) > (binary_expression right: (identifier) @font-lock-variable-name-fac= e) >=20=20 > - (arguments (identifier) @font-lock-variable-name-face)) > + (arguments (identifier) @font-lock-variable-name-face) > + > + (parenthesized_expression (identifier) @font-lock-variable-name-fac= e)) > + > + :language language > + :override t > + :feature 'property > + `((property_signature > + name: (property_identifier) @font-lock-property-face) > + (public_field_definition > + name: (property_identifier) @font-lock-property-face) > + (member_expression > + object: (identifier) @font-lock-variable-name-face > + property: (_) @font-lock-property-face) > + (member_expression > + object: (this) @font-lock-keyword-face Do we need this (this) here, or could that just go into the keyword feature? Otherwise LGTM. Go ahead and install, Yuan, unless you have something else to add :-) Theo