diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index f52b8f1f9019b8a457c7097fd34041ac08b45327..34380f0d3bf66943475c67da50ba0c23b01771fa 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -190,9 +190,15 @@ operator: "/" @operator (parameter (identifier) @variable.parameter) -(attribute_item (attribute (identifier) @attribute)) -(inner_attribute_item (attribute (identifier) @attribute)) +(attribute_item (attribute [ + (identifier) @attribute + (scoped_identifier name: (identifier) @attribute) +])) +(inner_attribute_item (attribute [ + (identifier) @attribute + (scoped_identifier name: (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 "::") +; Override the attribute match for paths in scoped type/enum identifiers. +(token_tree (identifier) @variable "::" (identifier) @type (#match? @type "^[A-Z]"))