From e618687cb8b589184e749390b46b950d6dc8319e 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 eee2f56b530..7b0fcb50853 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3536,14 +3536,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