on master help sign in
Fix Broken Attribute Highlights (#5349)
486c3abChickenkeeper
book/src/themes.md+4
@@ -140,6 +140,8 @@ We use a similar set of scopes as
140
140
141- `type` - Types
141- `type` - Types
142 - `builtin` - Primitive types provided by the language (`int`, `usize`)
142 - `builtin` - Primitive types provided by the language (`int`, `usize`)
143+ - `enum`
144+ - `variant`
143- `constructor`
145- `constructor`
144
146
145- `constant` (TODO: constant.other.placeholder for %v)
147- `constant` (TODO: constant.other.placeholder for %v)
@@ -202,6 +204,8 @@ We use a similar set of scopes as
202
204
203- `namespace`
205- `namespace`
204
206
207+- `special`
208+
205- `markup`
209- `markup`
206 - `heading`
210 - `heading`
207 - `marker`
211 - `marker`
runtime/queries/rust/highlights.scm+6−7
@@ -231,13 +231,6 @@
231((identifier) @type
231((identifier) @type
232 (#match? @type "^[A-Z]"))
232 (#match? @type "^[A-Z]"))
233
233
234−(attribute
235− (identifier) @_macro
236− arguments: (token_tree (identifier) @constant.numeric.integer)
237− (#eq? @_macro "derive")
238−)
239−@special
240−
241; -------
234; -------
242; Functions
235; Functions
243; -------
236; -------
@@ -269,6 +262,12 @@
269; Macros
262; Macros
270; ---
263; ---
271
264
265+(attribute
266+ (identifier) @special
267+ arguments: (token_tree (identifier) @type)
268+ (#eq? @special "derive")
269+)
270+
272(attribute
271(attribute
273 (identifier) @function.macro)
272 (identifier) @function.macro)
274(attribute
273(attribute