Skip to content

Commit

Permalink
fix(highlights): recognize ! as the never type (helix-editor#12485)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Revenco <[email protected]>
  • Loading branch information
2 people authored and rmburg committed Jan 20, 2025
1 parent b37731f commit 1af4a10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@
((identifier) @type
(#match? @type "^[A-Z]"))

(never_type "!" @type)

; -------
; Functions
; -------
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1af4a10

Please sign in to comment.