From 83ed9018ede57f6ef0e3645147fdb529490268fc Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 8 Dec 2023 03:58:18 +0200 Subject: [PATCH] (js--treesit-font-lock-settings): Highlight parameters in function expression * lisp/progmodes/js.el (js--treesit-font-lock-settings): Highlight parameters in a function expression (the node type 'function'). Make the matcher for 'formal_parameters' independent of the parent, that just created duplication. --- lisp/progmodes/js.el | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index b3c0f18e7b5..03f34647288 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3545,14 +3545,7 @@ Check if a node type is available, then return the right indent rules." (method_definition name: (property_identifier) @font-lock-function-name-face) - (method_definition - parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) - - (arrow_function - parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) - - (function_declaration - parameters: (formal_parameters (identifier) @font-lock-variable-name-face)) + (formal_parameters (identifier) @font-lock-variable-name-face) (variable_declarator name: (identifier) @font-lock-variable-name-face) -- 2.39.2