emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 92e8c0c091: ruby-ts-mode: Highlight more kinds of parameters


From: Dmitry Gutov
Subject: emacs-29 92e8c0c091: ruby-ts-mode: Highlight more kinds of parameters
Date: Fri, 6 Jan 2023 08:40:18 -0500 (EST)

branch: emacs-29
commit 92e8c0c091cdb67b27fa271814614ba4cab478d6
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    ruby-ts-mode: Highlight more kinds of parameters
    
    * lisp/progmodes/ruby-ts-mode.el
    (ruby-ts--font-lock-settings): Highlight destructured parameters,
    lambda parameters, identifiers in pattern matching clauses
    (array/hash) and exception variables.
    Move the 'symbol' matchers lower to make 'hash_key_symbol' lower
    priority than hash keys in match patterns.
---
 lisp/progmodes/ruby-ts-mode.el | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index 349318e757..87fd4ae535 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -215,13 +215,6 @@ values of OVERRIDE"
      (false) @font-lock-doc-markup-face
      (nil) @font-lock-doc-markup-face)
 
-   :language language
-   :feature 'symbol
-   '((bare_symbol) @font-lock-constant-face
-     (delimited_symbol (string_content) @font-lock-constant-face)
-     (hash_key_symbol) @font-lock-constant-face
-     (simple_symbol) @font-lock-constant-face)
-
    ;; Before 'operator so (unary) works.
    :language language
    :feature 'literal
@@ -303,7 +296,19 @@ values of OVERRIDE"
      (hash_splat_parameter
       name: (identifier) @font-lock-variable-name-face)
      (block_parameter
-      name: (identifier) @font-lock-variable-name-face))
+      name: (identifier) @font-lock-variable-name-face)
+     (destructured_parameter
+      (identifier) @font-lock-variable-name-face)
+     (lambda_parameters
+      (identifier) @font-lock-variable-name-face)
+     (exception_variable
+      (identifier) @font-lock-variable-name-face)
+     (array_pattern
+      (identifier) @font-lock-variable-name-face)
+     (keyword_pattern
+      key: (hash_key_symbol) @font-lock-variable-name-face)
+     (in_clause
+      pattern: (identifier) @font-lock-variable-name-face))
 
    ;; Yuan recommends also putting method definitions into the
    ;; 'function' category (thus keeping it in both).  I've opted to
@@ -322,6 +327,13 @@ values of OVERRIDE"
      (operator_assignment
       left: (identifier) @font-lock-variable-name-face))
 
+   :language language
+   :feature 'symbol
+   '((bare_symbol) @font-lock-constant-face
+     (delimited_symbol (string_content) @font-lock-constant-face)
+     (hash_key_symbol) @font-lock-constant-face
+     (simple_symbol) @font-lock-constant-face)
+
    :language language
    :feature 'error
    '((ERROR) @font-lock-warning-face)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]