]> git.eshelyaron.com Git - emacs.git/commitdiff
typescript-ts-mode: Highlight non-shorthand destructuring bindings
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 25 Feb 2023 01:54:31 +0000 (03:54 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 25 Feb 2023 01:54:31 +0000 (03:54 +0200)
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Highlight non-shorthand
variable bindings in object destructuring.

lisp/progmodes/typescript-ts-mode.el

index 64af5574f9fd5b6f06427596c748707e1b99f0f9..5b49b8f50a8fc5bf42e6b3e9252f4f16940892b4 100644 (file)
@@ -272,7 +272,9 @@ Argument LANGUAGE is either `typescript' or `tsx'."
    :language language
    :feature 'pattern
    `((pair_pattern
-      key: (property_identifier) @font-lock-property-ref-face)
+      key: (property_identifier) @font-lock-property-ref-face
+      value: [(identifier) @font-lock-variable-name-face
+              (assignment_pattern left: (identifier) @font-lock-variable-name-face)])
 
      (array_pattern (identifier) @font-lock-variable-name-face)