Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(highlights): recognize ! as the never type #12485

Merged
merged 5 commits into from
Jan 11, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 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 @@ -416,6 +418,7 @@
".."
"..="
"'"
"?"
] @operator

; -------
Expand Down Expand Up @@ -453,8 +456,6 @@
; Remaining Identifiers
; -------

"?" @special
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliberate and 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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok , i reverted it


(type_identifier) @type
(identifier) @variable
(field_identifier) @variable.other.member
Loading