Fix Broken Attribute Highlights (#5349)
* Update highlights.scm
* Update highlights.scm
* Update themes.md
commit486c3ab0d542f5d502eba4f97446bdeca71afefd
authorChickenkeeper <artofchrism@gmail.com>
dateMon 9 Jan 2023, 02:26 (4 years ago)
parentc4b0eb8
book/src/themes.md+4
@@ -140,6 +140,8 @@ We use a similar set of scopes as
140140
141141- `type` - Types
142142 - `builtin` - Primitive types provided by the language (`int`, `usize`)
143+ - `enum`
144+ - `variant`
143145- `constructor`
144146
145147- `constant` (TODO: constant.other.placeholder for %v)
@@ -202,6 +204,8 @@ We use a similar set of scopes as
202204
203205- `namespace`
204206
207+- `special`
208+
205209- `markup`
206210 - `heading`
207211 - `marker`
runtime/queries/rust/highlights.scm+6−7
@@ -231,13 +231,6 @@
231231((identifier) @type
232232 (#match? @type "^[A-Z]"))
233233
234−(attribute
235− (identifier) @_macro
236− arguments: (token_tree (identifier) @constant.numeric.integer)
237− (#eq? @_macro "derive")
238−)
239−@special
240−
241234; -------
242235; Functions
243236; -------
@@ -269,6 +262,12 @@
269262; Macros
270263; ---
271264
265+(attribute
266+ (identifier) @special
267+ arguments: (token_tree (identifier) @type)
268+ (#eq? @special "derive")
269+)
270+
272271(attribute
273272 (identifier) @function.macro)
274273(attribute