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 |
| --- | --- |
| <img width="886" height="398" alt="Bildschirmfoto 2025-09-03 um 10 39
25"
src="https://github.com/user-attachments/assets/dbc680e3-6ce3-4059-9934-9daa4c59d4a0"
/> | <img width="886" height="398" alt="Bildschirmfoto 2025-09-03 um 10
38 14"
src="https://github.com/user-attachments/assets/6e10df6f-5158-4bfd-81ab-8f2b384f1e99"
/> |


Release Notes:

- N/A
This commit is contained in:
Finn Evers
2025-09-03 09:02:21 +00:00
committed by GitHub
parent ae840c6ef3
commit 6feae92616
+2 -2
View File
@@ -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_]*$"))
]))