From f1aa306f91537251c73d1645ef1e0daf1cf327c4 Mon Sep 17 00:00:00 2001 From: Perry Smith Date: Fri, 6 Jan 2023 04:20:02 +0200 Subject: [PATCH] ruby-ts-mode: Highlight variable assignments * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): Bring back the 'assignment' feature. (ruby-ts-mode): Replace the unused 'variable' with 'assignment'. Use the level 3 for consistency with other ts modes. Update the Commentary as well. --- lisp/progmodes/ruby-ts-mode.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index e7087e06d85..9416b650eb1 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -55,7 +55,7 @@ ;; 3: builtin-variable builtin-constant constant ;; delimiter escape-sequence ;; global instance -;; interpolation literal symbol variable +;; interpolation literal symbol assignment ;; 4: bracket error function operator punctuation ;; Thus if treesit-font-lock-level is set to level 3 which is its @@ -298,6 +298,15 @@ values of OVERRIDE" '((call method: (identifier) @font-lock-function-name-face)) + :language language + :feature 'assignment + '((assignment + left: (identifier) @font-lock-variable-name-face) + (assignment + left: (left_assignment_list (identifier) @font-lock-variable-name-face)) + (operator_assignment + left: (identifier) @font-lock-variable-name-face)) + :language language :feature 'error '((ERROR) @font-lock-warning-face) @@ -932,7 +941,7 @@ leading double colon is not added." ( builtin-variable builtin-constant constant delimiter escape-sequence global instance - interpolation literal symbol variable) + interpolation literal symbol assignment) ( bracket error function operator punctuation))) (treesit-major-mode-setup)) -- 2.39.5