Fix & Tweak Rust's Syntax Highlighting (#5238)

pull/5119/head
Chickenkeeper 2 years ago committed by GitHub
parent d0a5e11c28
commit c4263d6a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,7 +45,8 @@
"'" @label
(identifier) @label)
(loop_label
(identifier) @type)
"'" @label
(identifier) @label)
; ---
; Punctuation
@ -102,8 +103,6 @@
(closure_parameters
(identifier) @variable.parameter)
; -------
; Keywords
; -------
@ -129,9 +128,7 @@
[
"break"
"continue"
"return"
"await"
] @keyword.control.return
@ -154,10 +151,7 @@
"trait"
"for"
"unsafe"
"default"
"macro_rules!"
"async"
] @keyword
@ -165,13 +159,13 @@
"struct"
"enum"
"union"
"type"
] @keyword.storage.type
"let" @keyword.storage
"fn" @keyword.function
"unsafe" @keyword.special
"macro_rules!" @function.macro
(mutable_specifier) @keyword.storage.modifier.mut
@ -202,11 +196,11 @@
(call_expression
function: [
((identifier) @type.variant
(#match? @type.variant "^[A-Z]"))
((identifier) @type.enum.variant
(#match? @type.enum.variant "^[A-Z]"))
(scoped_identifier
name: ((identifier) @type.variant
(#match? @type.variant "^[A-Z]")))
name: ((identifier) @type.enum.variant
(#match? @type.enum.variant "^[A-Z]")))
])
; ---
@ -237,8 +231,6 @@
((identifier) @type
(#match? @type "^[A-Z]"))
(attribute
(identifier) @_macro
arguments: (token_tree (identifier) @constant.numeric.integer)
@ -246,7 +238,6 @@
)
@special
; -------
; Functions
; -------
@ -303,8 +294,6 @@
(metavariable) @variable.parameter
(fragment_specifier) @type
; -------
; Operators
; -------
@ -350,8 +339,6 @@
"'"
] @operator
; -------
; Paths
; -------
@ -382,8 +369,6 @@
(scoped_type_identifier
path: (identifier) @namespace)
; -------
; Remaining Identifiers
; -------

Loading…
Cancel
Save