aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust
diff options
context:
space:
mode:
authorChickenkeeper2022-12-21 23:10:45 +0000
committerGitHub2022-12-21 23:10:45 +0000
commitc4263d6a56c6490b34a43c7d393fce321514b6ef (patch)
treeee67f3266619d048b99c199d084115933de71e12 /runtime/queries/rust
parentd0a5e11c28a3ad2533b79e2922ca06aa7036516c (diff)
Fix & Tweak Rust's Syntax Highlighting (#5238)
Diffstat (limited to 'runtime/queries/rust')
-rw-r--r--runtime/queries/rust/highlights.scm31
1 files changed, 8 insertions, 23 deletions
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index d3c29270..66058034 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -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
; -------