From 8f5f818c8837c8888abb9e83fdeecdb67f9c260a Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+nik-rev@users.noreply.github.com> Date: Sat, 11 Jan 2025 16:49:39 +0000 Subject: [PATCH] fix(highlights): recognize `!` as the never type (#12485) Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> --- runtime/queries/rust/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index b3a0f4d7..5cfbff59 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -311,6 +311,8 @@ ((identifier) @type (#match? @type "^[A-Z]")) +(never_type "!" @type) + ; ------- ; Functions ; ------- @@ -453,6 +455,7 @@ ; Remaining Identifiers ; ------- +; We do not style ? as an operator on purpose as it allows styling ? differently, as many highlighters do. @operator.special might have been a better scope, but @special is already documented so the change would break themes (including the intent of the default theme) "?" @special (type_identifier) @type