emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 5b2e6d04ce: Fix wrong capture in typescript-ts-mode (bug#60167)


From: Yuan Fu
Subject: emacs-29 5b2e6d04ce: Fix wrong capture in typescript-ts-mode (bug#60167)
Date: Sat, 17 Dec 2022 19:31:37 -0500 (EST)

branch: emacs-29
commit 5b2e6d04ce271cca2de944f8f5c07c005da33e37
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Yuan Fu <casouri@gmail.com>

    Fix wrong capture in typescript-ts-mode (bug#60167)
    
    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 890d0a8134..69616351ce 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -231,7 +231,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
      (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 @@ Argument LANGUAGE is either `typescript' or `tsx'."
    :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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]