From b49af03fb896ca1bcecfa6bb62e46b6bb5cd9921 Mon Sep 17 00:00:00 2001 From: MrSubidubi Date: Mon, 24 Feb 2025 21:27:49 +0100 Subject: [PATCH] Restore and update rust attribute highlights --- crates/languages/src/rust/highlights.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index 36e94ad2508e22..f52b8f1f9019b8 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -190,5 +190,9 @@ operator: "/" @operator (parameter (identifier) @variable.parameter) -(attribute_item) @attribute -(inner_attribute_item) @attribute +(attribute_item (attribute (identifier) @attribute)) +(inner_attribute_item (attribute (identifier) @attribute)) +; Match nested snake case identifiers in attribute items. +(token_tree (identifier) @attribute (#match? @attribute "^[a-z\\d_]*$")) +; Override the attribute match for paths in scoped identifiers. +(token_tree (identifier) @variable "::")