From 486c3ab0d542f5d502eba4f97446bdeca71afefd Mon Sep 17 00:00:00 2001 From: Chickenkeeper Date: Mon, 9 Jan 2023 02:26:08 +0000 Subject: [PATCH] Fix Broken Attribute Highlights (#5349) * Update highlights.scm * Update highlights.scm * Update themes.md --- book/src/themes.md | 4 ++++ runtime/queries/rust/highlights.scm | 13 ++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/book/src/themes.md b/book/src/themes.md index 0f94828eb..015ec59b3 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -140,6 +140,8 @@ We use a similar set of scopes as - `type` - Types - `builtin` - Primitive types provided by the language (`int`, `usize`) + - `enum` + - `variant` - `constructor` - `constant` (TODO: constant.other.placeholder for %v) @@ -202,6 +204,8 @@ We use a similar set of scopes as - `namespace` +- `special` + - `markup` - `heading` - `marker` diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 66058034b..bf2fde499 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -231,13 +231,6 @@ ((identifier) @type (#match? @type "^[A-Z]")) -(attribute - (identifier) @_macro - arguments: (token_tree (identifier) @constant.numeric.integer) - (#eq? @_macro "derive") -) -@special - ; ------- ; Functions ; ------- @@ -269,6 +262,12 @@ ; Macros ; --- +(attribute + (identifier) @special + arguments: (token_tree (identifier) @type) + (#eq? @special "derive") +) + (attribute (identifier) @function.macro) (attribute