Subject: bug#60167: closed (Re: bug#60167: 30.0.50; [PATCH]: Fix wrong capture in typescript-ts-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 18 Dec 2022 08:10:01 +0000

Your bug report

#60167: 30.0.50; [PATCH]: Fix wrong capture in typescript-ts-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
60167: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60167
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60167: 30.0.50; [PATCH]: Fix wrong capture in typescript-ts-mode
From: Yuan Fu <[email-masked]>
To: Theodor Thornhill <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sun, 18 Dec 2022 00:08:59 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Theodor Thornhill <[email-masked]> writes:

> On 18 December 2022 00:37:30 CET, Yuan Fu <[email-masked]> wrote:
>>
>>Theodor Thornhill <[email-masked]> writes:
>>
>>> Hi there!
>>>
>>> We've had a small regression after
>>> fbf0d3b796ac1b891be35b642878a1fd412ee5ea, and this patch fixes that.
>>> Yuan, want to apply after Josteins agrees on this fix?  There's an
>>> example of the currently failing code in the commit message.  There's
>>> also a small whitespace fix inside - I hope that's ok.
>>>
>>> Thanks guys :-)
>>>
>>> Theo
>>
>>Cool, I’ll wait for Jostein’s opinion :-)
>>
>>Yuan
>
> He agreed :)
> Theo

Yeah I think I saw his message but it didn’t appear on debbugs for some
reason. Anyway, I applied the patch, thanks!

Yuan

Subject: 30.0.50; [PATCH]: Fix wrong capture in typescript-ts-mode
From: Theodor Thornhill <[email-masked]>
To: [email-masked]
Date: Sat, 17 Dec 2022 20:15:17 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi there!

We've had a small regression after
fbf0d3b796ac1b891be35b642878a1fd412ee5ea, and this patch fixes that.
Yuan, want to apply after Josteins agrees on this fix?  There's an
example of the currently failing code in the commit message.  There's
also a small whitespace fix inside - I hope that's ok.

Thanks guys :-)

Theo

>From 931e96cd042aefe2807329de84751aa1a9e45bbb Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <[email-masked]>
Date: Sat, 17 Dec 2022 20:07:59 +0100
Subject: [PATCH] Fix wrong capture in typescript-ts-mode

An example of the issue could be:

    <Menu.Item>
        {({ active }) => (
          link
            ? <Link to={link}> {text}</Link>
            : <a href="#" onClick={onClick}>{text}</a>
        )}
    </Menu.Item>

Here 'link' as well as a lot of the other constructs inside of the
parenthesized expression will be font-locked with
'font-lock-variable-name-face'.  We only want to capture the
identifier.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Make the variable capture
only capture the identifier, and not the whole expression.
---
 lisp/progmodes/typescript-ts-mode.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index e7bd65c5e2..5eb810dd1d 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -231,7 +231,7 @@ typescript-ts-mode--font-lock-settings
      (arguments (identifier) @font-lock-variable-name-face)
 
      (parenthesized_expression (identifier) @font-lock-variable-name-face)
-     (parenthesized_expression (_ (identifier)) @font-lock-variable-name-face))
+     (parenthesized_expression (_ (identifier) @font-lock-variable-name-face)))
 
    :language language
    :override t
@@ -316,10 +316,7 @@ typescript-ts-mode--font-lock-settings
    :language language
    :feature 'escape-sequence
    :override t
-   '((escape_sequence) @font-lock-escape-face)
-
-
-   ))
+   '((escape_sequence) @font-lock-escape-face)))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
-- 
2.34.1