aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
authorGokul Soumya2021-12-23 03:10:24 +0000
committerGitHub2021-12-23 03:10:24 +0000
commita8618cf1119afe439916b775f0dd5710fdb5082f (patch)
tree26ed2ffda8b0d61032cf858233315ee8d3cf2908 /runtime/queries
parent34766e242ab0a059c8313b068b98d275e2a879b8 (diff)
Add precise rust queries for use, mod, as (#1339)
- Differentiates between `as` keyword as a binary type cast operator and import renamer. - `mod` and `use` are now under `@keyword.control.import`, but `mod` is a `@keyword` if used as `mod name;`.
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/rust/highlights.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index 60dd4644..26496c66 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -127,11 +127,16 @@
"await"
] @keyword.control
+"use" @keyword.control.import
+(mod_item "mod" @keyword.control.import !body)
+(use_as_clause "as" @keyword.control.import)
+
+(type_cast_expression "as" @keyword.operator)
+
[
(crate)
(super)
"as"
- "use"
"pub"
"mod"
"extern"