diff options
| -rw-r--r-- | CONTRIBUTING.md | 2 | ||||
| -rw-r--r-- | queries/lalrpop/highlights.scm | 9 | ||||
| -rw-r--r-- | queries/rust/highlights.scm | 12 |
3 files changed, 17 insertions, 6 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b024961a9..8e3081e82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,7 +140,7 @@ As languages differ quite a lot, here is a set of captures available to you when @type.builtin ; built-in types @type.definition ; identifiers in type definitions (e.g. `typedef <type> <identifier>` in C) -@attribute ; attribute annotations (e.g. Python decorators) +@attribute ; attribute annotations (e.g. Python decorators, Rust lifetimes) @attribute.builtin ; builtin annotations (e.g. `@property` in Python) @property ; the key in key/value pairs ``` diff --git a/queries/lalrpop/highlights.scm b/queries/lalrpop/highlights.scm index a3cf8d897..951192ea8 100644 --- a/queries/lalrpop/highlights.scm +++ b/queries/lalrpop/highlights.scm @@ -72,7 +72,14 @@ ] @punctuation.delimiter (lifetime - (identifier) @keyword.modifier) + "'" @keyword.modifier) + +(lifetime + (identifier) @attribute) + +(lifetime + (identifier) @attribute.builtin + (#any-of? @attribute.builtin "static" "_")) (string_literal) @string diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index 7b229984f..64976b663 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -285,10 +285,14 @@ ] @keyword.modifier (lifetime - [ - "'" - (identifier) - ] @keyword.modifier) + "'" @keyword.modifier) + +(lifetime + (identifier) @attribute) + +(lifetime + (identifier) @attribute.builtin + (#any-of? @attribute.builtin "static" "_")) "fn" @keyword.function |
