From d1d4691d3e788795b0bb7b21c19249fddda3ef14 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 5570cca42c6..b3a0f5a7c04 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3536,7 +3536,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