From dc9b733ab88f3a3a885b78b670489a1fd2d97f8b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 8 Dec 2023 04:20:39 +0200 Subject: [PATCH] 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) -- 2.39.2