From d3f6ca7a1ed257f9957e5ba64c8117acd6a7d4e9 Mon Sep 17 00:00:00 2001 From: James Thurley Date: Thu, 25 Apr 2024 19:20:20 +0100 Subject: [PATCH] Add @operator, @lifetime and @punctuation.delimiters captures for Rust (#10885) Adds additional captures for theming rust code. I'm uncertain about whether `#` belongs in the `@operator` capture, but I didn't see a more appropriate capture name in my brief hunt in other files. It is the prefix of an `attribute_item`.. suggestions welcome. Release Notes: - Added `@operator`, `@lifetime` and `@punctuation.delimiter` captures to Rust highlights file. --- crates/languages/src/rust/highlights.scm | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index 79a50185aadbf2ffc77a53f4b53ac88049187d17..b98812fe3914a2574649fce59c0bfef3a58035af 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -64,6 +64,16 @@ "<" @punctuation.bracket ">" @punctuation.bracket) +[ + ";" + "," + "::" +] @punctuation.delimiter + +[ + "#" +] @punctuation.special + [ "as" "async" @@ -122,3 +132,50 @@ (line_comment) (block_comment) ] @comment + +[ + "!" + "!=" + "%" + "%=" + "&" + "&=" + "&&" + "*" + "*=" + "*" + "+" + "+=" + "," + "-" + "-=" + "->" + "." + ".." + "..=" + "..." + "/" + "/=" + ":" + ";" + "<<" + "<<=" + "<" + "<=" + "=" + "==" + "=>" + ">" + ">=" + ">>" + ">>=" + "@" + "^" + "^=" + "|" + "|=" + "||" + "?" +] @operator + +(lifetime) @lifetime