[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 f1aa306f91: ruby-ts-mode: Highlight variable assignments
From: |
Dmitry Gutov |
Subject: |
emacs-29 f1aa306f91: ruby-ts-mode: Highlight variable assignments |
Date: |
Thu, 5 Jan 2023 21:25:21 -0500 (EST) |
branch: emacs-29
commit f1aa306f91537251c73d1645ef1e0daf1cf327c4
Author: Perry Smith <pedz@easesoftware.com>
Commit: Dmitry Gutov <dgutov@yandex.ru>
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 e7087e06d8..9416b650eb 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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 f1aa306f91: ruby-ts-mode: Highlight variable assignments,
Dmitry Gutov <=