Unnamed repository; edit this file 'description' to name the repository.
fix(highlights): recognize `!` as the never type (#12485)
Co-authored-by: Nikita Revenco <[email protected]>
Nikita Revenco 2025-01-11
parent b26903c · commit 8f5f818
-rw-r--r--runtime/queries/rust/highlights.scm3
1 files changed, 3 insertions, 0 deletions
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