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.
This commit is contained in:
Perry Smith 2023-01-06 04:20:02 +02:00 committed by Dmitry Gutov
parent 089b08eb3e
commit f1aa306f91

View file

@ -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))