ruby-ts-mode: Highlight method and block parameters
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): Add rules for method and block parameters. (ruby-ts-mode): Add corresponding feature.
This commit is contained in:
parent
f1aa306f91
commit
0f5e74f173
1 changed files with 16 additions and 1 deletions
|
@ -290,6 +290,21 @@ values of OVERRIDE"
|
||||||
(method
|
(method
|
||||||
name: (setter) @font-lock-function-name-face))
|
name: (setter) @font-lock-function-name-face))
|
||||||
|
|
||||||
|
:language language
|
||||||
|
:feature 'parameter-definition
|
||||||
|
'((method_parameters
|
||||||
|
(identifier) @font-lock-variable-name-face)
|
||||||
|
(block_parameters
|
||||||
|
(identifier) @font-lock-variable-name-face)
|
||||||
|
(optional_parameter
|
||||||
|
name: (identifier) @font-lock-variable-name-face)
|
||||||
|
(splat_parameter
|
||||||
|
name: (identifier) @font-lock-variable-name-face)
|
||||||
|
(hash_splat_parameter
|
||||||
|
name: (identifier) @font-lock-variable-name-face)
|
||||||
|
(block_parameter
|
||||||
|
name: (identifier) @font-lock-variable-name-face))
|
||||||
|
|
||||||
;; Yuan recommends also putting method definitions into the
|
;; Yuan recommends also putting method definitions into the
|
||||||
;; 'function' category (thus keeping it in both). I've opted to
|
;; 'function' category (thus keeping it in both). I've opted to
|
||||||
;; just use separate categories for them -- dgutov.
|
;; just use separate categories for them -- dgutov.
|
||||||
|
@ -936,7 +951,7 @@ leading double colon is not added."
|
||||||
(setq-local treesit-font-lock-settings (ruby-ts--font-lock-settings 'ruby))
|
(setq-local treesit-font-lock-settings (ruby-ts--font-lock-settings 'ruby))
|
||||||
;; Level 3 is the default.
|
;; Level 3 is the default.
|
||||||
(setq-local treesit-font-lock-feature-list
|
(setq-local treesit-font-lock-feature-list
|
||||||
'(( comment method-definition )
|
'(( comment method-definition parameter-definition)
|
||||||
( keyword regexp string type)
|
( keyword regexp string type)
|
||||||
( builtin-variable builtin-constant constant
|
( builtin-variable builtin-constant constant
|
||||||
delimiter escape-sequence
|
delimiter escape-sequence
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue