mirror of https://github.com/helix-editor/helix
Fix & Tweak Rust's Syntax Highlighting (#5238)
parent
d0a5e11c28
commit
c4263d6a56
|
@ -45,7 +45,8 @@
|
||||||
"'" @label
|
"'" @label
|
||||||
(identifier) @label)
|
(identifier) @label)
|
||||||
(loop_label
|
(loop_label
|
||||||
(identifier) @type)
|
"'" @label
|
||||||
|
(identifier) @label)
|
||||||
|
|
||||||
; ---
|
; ---
|
||||||
; Punctuation
|
; Punctuation
|
||||||
|
@ -102,8 +103,6 @@
|
||||||
(closure_parameters
|
(closure_parameters
|
||||||
(identifier) @variable.parameter)
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -------
|
; -------
|
||||||
; Keywords
|
; Keywords
|
||||||
; -------
|
; -------
|
||||||
|
@ -129,9 +128,7 @@
|
||||||
[
|
[
|
||||||
"break"
|
"break"
|
||||||
"continue"
|
"continue"
|
||||||
|
|
||||||
"return"
|
"return"
|
||||||
|
|
||||||
"await"
|
"await"
|
||||||
] @keyword.control.return
|
] @keyword.control.return
|
||||||
|
|
||||||
|
@ -154,10 +151,7 @@
|
||||||
"trait"
|
"trait"
|
||||||
"for"
|
"for"
|
||||||
|
|
||||||
"unsafe"
|
|
||||||
"default"
|
"default"
|
||||||
"macro_rules!"
|
|
||||||
|
|
||||||
"async"
|
"async"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
@ -165,13 +159,13 @@
|
||||||
"struct"
|
"struct"
|
||||||
"enum"
|
"enum"
|
||||||
"union"
|
"union"
|
||||||
|
|
||||||
"type"
|
"type"
|
||||||
] @keyword.storage.type
|
] @keyword.storage.type
|
||||||
|
|
||||||
"let" @keyword.storage
|
"let" @keyword.storage
|
||||||
|
|
||||||
"fn" @keyword.function
|
"fn" @keyword.function
|
||||||
|
"unsafe" @keyword.special
|
||||||
|
"macro_rules!" @function.macro
|
||||||
|
|
||||||
(mutable_specifier) @keyword.storage.modifier.mut
|
(mutable_specifier) @keyword.storage.modifier.mut
|
||||||
|
|
||||||
|
@ -202,11 +196,11 @@
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: [
|
function: [
|
||||||
((identifier) @type.variant
|
((identifier) @type.enum.variant
|
||||||
(#match? @type.variant "^[A-Z]"))
|
(#match? @type.enum.variant "^[A-Z]"))
|
||||||
(scoped_identifier
|
(scoped_identifier
|
||||||
name: ((identifier) @type.variant
|
name: ((identifier) @type.enum.variant
|
||||||
(#match? @type.variant "^[A-Z]")))
|
(#match? @type.enum.variant "^[A-Z]")))
|
||||||
])
|
])
|
||||||
|
|
||||||
; ---
|
; ---
|
||||||
|
@ -237,8 +231,6 @@
|
||||||
((identifier) @type
|
((identifier) @type
|
||||||
(#match? @type "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(attribute
|
(attribute
|
||||||
(identifier) @_macro
|
(identifier) @_macro
|
||||||
arguments: (token_tree (identifier) @constant.numeric.integer)
|
arguments: (token_tree (identifier) @constant.numeric.integer)
|
||||||
|
@ -246,7 +238,6 @@
|
||||||
)
|
)
|
||||||
@special
|
@special
|
||||||
|
|
||||||
|
|
||||||
; -------
|
; -------
|
||||||
; Functions
|
; Functions
|
||||||
; -------
|
; -------
|
||||||
|
@ -303,8 +294,6 @@
|
||||||
(metavariable) @variable.parameter
|
(metavariable) @variable.parameter
|
||||||
(fragment_specifier) @type
|
(fragment_specifier) @type
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -------
|
; -------
|
||||||
; Operators
|
; Operators
|
||||||
; -------
|
; -------
|
||||||
|
@ -350,8 +339,6 @@
|
||||||
"'"
|
"'"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -------
|
; -------
|
||||||
; Paths
|
; Paths
|
||||||
; -------
|
; -------
|
||||||
|
@ -382,8 +369,6 @@
|
||||||
(scoped_type_identifier
|
(scoped_type_identifier
|
||||||
path: (identifier) @namespace)
|
path: (identifier) @namespace)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -------
|
; -------
|
||||||
; Remaining Identifiers
|
; Remaining Identifiers
|
||||||
; -------
|
; -------
|
||||||
|
|
Loading…
Reference in New Issue