summaryrefslogtreecommitdiff
path: root/runtime/queries/rust
diff options
context:
space:
mode:
authorPoliorcetics2022-10-29 15:36:26 +0000
committerGitHub2022-10-29 15:36:26 +0000
commit2935e9da197442620578e07d87cd0607ae4145f1 (patch)
tree8360ab6fdc78f86e190edf3022e299ec2450c92f /runtime/queries/rust
parente3eaad14790fb72995ce233a7cd6cd8c249997c0 (diff)
feat: Categorize Rust's keywords using more specific scopes (#4510)
Diffstat (limited to 'runtime/queries/rust')
-rw-r--r--runtime/queries/rust/highlights.scm36
1 files changed, 24 insertions, 12 deletions
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index 81f05f7a..0afb8388 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -111,23 +111,31 @@
; -------
(for_expression
- "for" @keyword.control)
+ "for" @keyword.control.repeat)
((identifier) @keyword.control
(#match? @keyword.control "^yield$"))
+
+"in" @keyword.control
+
+[
+ "match"
+ "if"
+ "else"
+] @keyword.control.conditional
+
[
"while"
"loop"
- "in"
+] @keyword.control.repeat
+
+[
"break"
"continue"
- "match"
- "if"
- "else"
"return"
"await"
-] @keyword.control
+] @keyword.control.return
"use" @keyword.control.import
(mod_item "mod" @keyword.control.import !body)
@@ -143,24 +151,28 @@
"mod"
"extern"
- "struct"
- "enum"
"impl"
"where"
"trait"
"for"
- "type"
- "union"
"unsafe"
"default"
"macro_rules!"
- "let"
-
"async"
] @keyword
+[
+ "struct"
+ "enum"
+ "union"
+
+ "type"
+] @keyword.storage.type
+
+"let" @keyword.storage
+
"fn" @keyword.function
(mutable_specifier) @keyword.storage.modifier.mut