mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-02 02:17:44 +03:00
Fix Ruby highlights (#13055)
This commit is contained in:
parent
1bd7a3901c
commit
0d84bd563c
1 changed files with 60 additions and 59 deletions
|
@ -39,19 +39,60 @@
|
|||
"%i("
|
||||
] @punctuation.bracket
|
||||
|
||||
; Literals
|
||||
|
||||
[
|
||||
(string)
|
||||
(bare_string)
|
||||
(subshell)
|
||||
(heredoc_body)
|
||||
(heredoc_beginning)
|
||||
] @string
|
||||
|
||||
[
|
||||
(simple_symbol)
|
||||
(delimited_symbol)
|
||||
(bare_symbol)
|
||||
] @string.special.symbol
|
||||
|
||||
(pair key: ((_)":" @string.special.symbol) @string.special.symbol)
|
||||
|
||||
(regex) @string.regexp
|
||||
(escape_sequence) @constant.character.escape
|
||||
|
||||
[
|
||||
(integer)
|
||||
(float)
|
||||
] @constant.numeric.integer
|
||||
|
||||
[
|
||||
(nil)
|
||||
(true)
|
||||
(false)
|
||||
] @constant.builtin
|
||||
|
||||
(interpolation
|
||||
"#{" @punctuation.special
|
||||
"}" @punctuation.special) @embedded
|
||||
|
||||
(comment) @comment
|
||||
|
||||
; Identifiers
|
||||
|
||||
((identifier) @function.method
|
||||
(#is-not? local))
|
||||
|
||||
[
|
||||
(identifier)
|
||||
] @variable
|
||||
((identifier) @function.method
|
||||
(#is-not? local))
|
||||
|
||||
[
|
||||
(class_variable)
|
||||
(instance_variable)
|
||||
] @variable.other.member
|
||||
|
||||
(constant) @constructor
|
||||
|
||||
((identifier) @constant.builtin
|
||||
(#match? @constant.builtin "^(__FILE__|__LINE__|__ENCODING__)$"))
|
||||
|
||||
|
@ -61,8 +102,6 @@
|
|||
((constant) @constant
|
||||
(#match? @constant "^[A-Z\\d_]+$"))
|
||||
|
||||
(constant) @constructor
|
||||
|
||||
(self) @variable.builtin
|
||||
(super) @function.builtin
|
||||
|
||||
|
@ -76,6 +115,23 @@
|
|||
(block_parameter (identifier) @variable.parameter)
|
||||
(block_parameters (identifier) @variable.parameter)
|
||||
|
||||
; Function definitions
|
||||
|
||||
(alias (identifier) @function.method)
|
||||
(setter (identifier) @function.method)
|
||||
(method name: [(identifier) (constant)] @function.method)
|
||||
(singleton_method name: [(identifier) (constant)] @function.method)
|
||||
|
||||
; Function calls
|
||||
|
||||
(call
|
||||
method: [(identifier) (constant)] @function.method)
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#match? @function.builtin "^(attr|attr_accessor|attr_reader|attr_writer|include|prepend|refine|private|protected|public)$"))
|
||||
|
||||
"defined?" @function.builtin
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
|
@ -133,58 +189,3 @@
|
|||
|
||||
((identifier) @keyword.control.exception
|
||||
(#match? @keyword.control.exception "^(raise|fail)$"))
|
||||
|
||||
; Function calls
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#match? @function.builtin "^(attr|attr_accessor|attr_reader|attr_writer|include|prepend|refine|private|protected|public)$"))
|
||||
|
||||
"defined?" @function.builtin
|
||||
|
||||
(call
|
||||
method: [(identifier) (constant)] @function.method)
|
||||
|
||||
; Function definitions
|
||||
|
||||
(alias (identifier) @function.method)
|
||||
(setter (identifier) @function.method)
|
||||
(method name: [(identifier) (constant)] @function.method)
|
||||
(singleton_method name: [(identifier) (constant)] @function.method)
|
||||
|
||||
; Literals
|
||||
|
||||
[
|
||||
(string)
|
||||
(bare_string)
|
||||
(subshell)
|
||||
(heredoc_body)
|
||||
(heredoc_beginning)
|
||||
] @string
|
||||
|
||||
[
|
||||
(simple_symbol)
|
||||
(delimited_symbol)
|
||||
(bare_symbol)
|
||||
] @string.special.symbol
|
||||
|
||||
(pair key: ((_)":" @string.special.symbol) @string.special.symbol)
|
||||
|
||||
(regex) @string.regexp
|
||||
(escape_sequence) @constant.character.escape
|
||||
|
||||
[
|
||||
(integer)
|
||||
(float)
|
||||
] @constant.numeric.integer
|
||||
|
||||
[
|
||||
(nil)
|
||||
(true)
|
||||
(false)
|
||||
] @constant.builtin
|
||||
|
||||
(interpolation
|
||||
"#{" @punctuation.special
|
||||
"}" @punctuation.special) @embedded
|
||||
|
||||
(comment) @comment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue