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:
parent
089b08eb3e
commit
f1aa306f91
1 changed files with 11 additions and 2 deletions
|
@ -55,7 +55,7 @@
|
||||||
;; 3: builtin-variable builtin-constant constant
|
;; 3: builtin-variable builtin-constant constant
|
||||||
;; delimiter escape-sequence
|
;; delimiter escape-sequence
|
||||||
;; global instance
|
;; global instance
|
||||||
;; interpolation literal symbol variable
|
;; interpolation literal symbol assignment
|
||||||
;; 4: bracket error function operator punctuation
|
;; 4: bracket error function operator punctuation
|
||||||
|
|
||||||
;; Thus if treesit-font-lock-level is set to level 3 which is its
|
;; Thus if treesit-font-lock-level is set to level 3 which is its
|
||||||
|
@ -298,6 +298,15 @@ values of OVERRIDE"
|
||||||
'((call
|
'((call
|
||||||
method: (identifier) @font-lock-function-name-face))
|
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
|
:language language
|
||||||
:feature 'error
|
:feature 'error
|
||||||
'((ERROR) @font-lock-warning-face)
|
'((ERROR) @font-lock-warning-face)
|
||||||
|
@ -932,7 +941,7 @@ leading double colon is not added."
|
||||||
( builtin-variable builtin-constant constant
|
( builtin-variable builtin-constant constant
|
||||||
delimiter escape-sequence
|
delimiter escape-sequence
|
||||||
global instance
|
global instance
|
||||||
interpolation literal symbol variable)
|
interpolation literal symbol assignment)
|
||||||
( bracket error function operator punctuation)))
|
( bracket error function operator punctuation)))
|
||||||
|
|
||||||
(treesit-major-mode-setup))
|
(treesit-major-mode-setup))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue