aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md17
-rw-r--r--queries/rust/highlights.scm17
2 files changed, 21 insertions, 13 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ea3cbc408..5a6fd71ec 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -156,15 +156,16 @@ effect on highlighting. We will work on improving highlighting in the near futur
#### Types
```scheme
-@type ; type or class definitions and annotations
-@type.builtin ; built-in types
-@type.definition ; type definitions (e.g. `typedef` in C)
-@type.qualifier ; type qualifiers (e.g. `const`)
+@type ; type or class definitions and annotations
+@type.builtin ; built-in types
+@type.definition ; type definitions (e.g. `typedef` in C)
+@type.qualifier ; type qualifiers (e.g. `const`)
-@storageclass ; visibility/life-time/etc. modifiers (e.g. `static`)
-@attribute ; attribute annotations (e.g. Python decorators)
-@field ; object and struct fields
-@property ; similar to `@field`
+@storageclass ; visibility/life-time modifiers
+@storageclass.lifetime ; life-time modifiers (e.g. `static`)
+@attribute ; attribute annotations (e.g. Python decorators)
+@field ; object and struct fields
+@property ; similar to `@field`
```
#### Identifiers
diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm
index 779309f6e..c7cd1174b 100644
--- a/queries/rust/highlights.scm
+++ b/queries/rust/highlights.scm
@@ -25,7 +25,6 @@
(self) @variable.builtin
-(lifetime ["'" (identifier)] @label)
(loop_label ["'" (identifier)] @label)
@@ -172,7 +171,6 @@
[
"async"
"await"
- "const"
"default"
"dyn"
"enum"
@@ -182,17 +180,26 @@
"match"
"move"
"pub"
- "ref"
- "static"
"struct"
"trait"
"type"
"union"
"unsafe"
"where"
- (mutable_specifier)
] @keyword
+[
+ "ref"
+ (mutable_specifier)
+] @type.qualifier
+
+[
+ "const"
+ "static"
+] @storageclass
+
+(lifetime ["'" (identifier)] @storageclass.lifetime)
+
"fn" @keyword.function
[
"return"