From: Dmitry Gutov Date: Sun, 8 Jan 2023 01:56:32 +0000 (+0200) Subject: (ruby-ts--font-lock-settings): Improve highlighting in patterns X-Git-Tag: emacs-29.0.90~804 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee3e8d3f927eba45b6863d4b2448376aacb02501;p=emacs.git (ruby-ts--font-lock-settings): Improve highlighting in patterns * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): Improve highlighting in patterns: highlight values not keys as variable in the usual case; highlight keys when no value; highlight the "as pattern" variable. --- diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 5f5de500435..9ec771e2fff 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -304,7 +304,12 @@ values of OVERRIDE" (array_pattern (identifier) @font-lock-variable-name-face) (keyword_pattern - key: (hash_key_symbol) @font-lock-variable-name-face) + value: (identifier) @font-lock-variable-name-face) + (keyword_pattern + key: (hash_key_symbol) @font-lock-variable-name-face + !value) + (as_pattern + name: (identifier) @font-lock-variable-name-face) (in_clause pattern: (identifier) @font-lock-variable-name-face))