From 68e68dfeefe0ac64d4ec6c31d046ae5957741109 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jostein=20Kj=C3=B8nigsen?= Date: Mon, 2 Jan 2023 21:26:36 +0100 Subject: [PATCH] Improve fontification consistency in js-ts-mode (bug#60503) * lisp/progmodes/js.el (js--treesit-font-lock-settings): Highlight declared parameters in functions, methods and arrow-expressions as variables. --- lisp/progmodes/js.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index c5fdecae71b..050472002bb 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3521,6 +3521,15 @@ This function is intended for use in `after-change-functions'." (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)) + (variable_declarator name: (identifier) @font-lock-variable-name-face) -- 2.39.2