Skip to content

Commit 2dc4f15

Browse files
authored
Revert "Capture shorthand_field_initializer and modules in Rust highlights (#35842)" (#36880)
This PR reverts #35842, as it broke the syntax highlighting for `crate`: ### Before Revert <img width="367" height="70" alt="Screenshot 2025-08-25 at 11 29 50 AM" src="https://github.com/user-attachments/assets/ce9b8b59-4e89-43ed-84c7-95c0156b9168" /> ### After Revert <img width="353" height="69" alt="Screenshot 2025-08-25 at 11 32 17 AM" src="https://github.com/user-attachments/assets/b6df5a21-64db-4abf-aa76-f085236da0c4" /> This reverts commit 896a35f. Release Notes: - Reverted #35842.
1 parent 557753d commit 2dc4f15

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

crates/languages/src/rust/highlights.scm

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
(self) @variable.special
77
(field_identifier) @property
88

9-
(shorthand_field_initializer
10-
(identifier) @property)
11-
129
(trait_item name: (type_identifier) @type.interface)
1310
(impl_item trait: (type_identifier) @type.interface)
1411
(abstract_type trait: (type_identifier) @type.interface)
@@ -41,20 +38,11 @@
4138
(identifier) @function.special
4239
(scoped_identifier
4340
name: (identifier) @function.special)
44-
]
45-
"!" @function.special)
41+
])
4642

4743
(macro_definition
4844
name: (identifier) @function.special.definition)
4945

50-
(mod_item
51-
name: (identifier) @module)
52-
53-
(visibility_modifier [
54-
(crate) @keyword
55-
(super) @keyword
56-
])
57-
5846
; Identifier conventions
5947

6048
; Assume uppercase names are types/enum-constructors
@@ -127,7 +115,9 @@
127115
"where"
128116
"while"
129117
"yield"
118+
(crate)
130119
(mutable_specifier)
120+
(super)
131121
] @keyword
132122

133123
[
@@ -199,7 +189,6 @@
199189
operator: "/" @operator
200190

201191
(lifetime) @lifetime
202-
(lifetime (identifier) @lifetime)
203192

204193
(parameter (identifier) @variable.parameter)
205194

0 commit comments

Comments
 (0)