From 6feae92616d473b0df61b6eb84cca3e8ea8115b6 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Wed, 3 Sep 2025 11:02:21 +0200 Subject: [PATCH] rust: Improve highlighting in derive macros (#37439) Follow-up to https://github.com/zed-industries/zed/pull/37049 This fixes an issue where we would lose highlighting in derive macros if one of the names was qualified. | Before | After | | --- | --- | | Bildschirmfoto 2025-09-03 um 10 39
25 | Bildschirmfoto 2025-09-03 um 10
38 14 | Release Notes: - N/A --- crates/languages/src/rust/highlights.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/rust/highlights.scm b/crates/languages/src/rust/highlights.scm index 3f44c5fc0e46d280f63d0b212cc237ba4cbb0e8b..ec7e2d42510c58d25f09c13e78d2f75bf7d20b5c 100644 --- a/crates/languages/src/rust/highlights.scm +++ b/crates/languages/src/rust/highlights.scm @@ -196,12 +196,12 @@ operator: "/" @operator (identifier) @attribute (scoped_identifier name: (identifier) @attribute) (token_tree (identifier) @attribute (#match? @attribute "^[a-z\\d_]*$")) - (token_tree (identifier) @variable "::" (identifier) @type (#match? @type "^[A-Z]")) + (token_tree (identifier) @none "::" (#match? @none "^[a-z\\d_]*$")) ])) (inner_attribute_item (attribute [ (identifier) @attribute (scoped_identifier name: (identifier) @attribute) (token_tree (identifier) @attribute (#match? @attribute "^[a-z\\d_]*$")) - (token_tree (identifier) @variable "::" (identifier) @type (#match? @type "^[A-Z]")) + (token_tree (identifier) @none "::" (#match? @none "^[a-z\\d_]*$")) ]))