emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 dc9b733ab88 4/4: js-ts-mode: Highlight function parameters insi


From: Dmitry Gutov
Subject: emacs-29 dc9b733ab88 4/4: js-ts-mode: Highlight function parameters inside destructuring
Date: Thu, 7 Dec 2023 21:21:44 -0500 (EST)

branch: emacs-29
commit dc9b733ab88f3a3a885b78b670489a1fd2d97f8b
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    js-ts-mode: Highlight function parameters inside destructuring
    
    * lisp/progmodes/js.el (js--treesit-font-lock-settings):
    Highlight function parameters declared using destructuring syntax.
---
 lisp/progmodes/js.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index eb4adc627ee..07d12cb7b4b 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3545,7 +3545,10 @@ Check if a node type is available, then return the right 
indent rules."
      (method_definition
       name: (property_identifier) @font-lock-function-name-face)
 
-     (formal_parameters (identifier) @font-lock-variable-name-face)
+     (formal_parameters
+      [(identifier) @font-lock-variable-name-face
+       (array_pattern (identifier) @font-lock-variable-name-face)
+       (object_pattern (shorthand_property_identifier_pattern) 
@font-lock-variable-name-face)])
 
      (variable_declarator
       name: (identifier) @font-lock-variable-name-face)



reply via email to

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