Skip to content

Commit

Permalink
Highlight types and enum members in the rust prelude (#8535)
Browse files Browse the repository at this point in the history
* Add some rust builtins

* rust queries: Add everything in the 2021 prelude

* Update runtime/queries/rust/highlights.scm

Co-authored-by: Michael Davis <[email protected]>

---------

Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
TheZoq2 and the-mikedavis authored Aug 14, 2024
1 parent f65ec32 commit f9aae99
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions runtime/queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,55 @@
"'" @label
(identifier) @label)

; ---
; Prelude
; ---

((identifier) @type.enum.variant.builtin
(#any-of? @type.enum.variant.builtin "Some" "None" "Ok" "Err"))



((type_identifier) @type.builtin
(#any-of?
@type.builtin
"Send"
"Sized"
"Sync"
"Unpin"
"Drop"
"Fn"
"FnMut"
"FnOnce"
"AsMut"
"AsRef"
"From"
"Into"
"DoubleEndedIterator"
"ExactSizeIterator"
"Extend"
"IntoIterator"
"Iterator"
"Option"
"Result"
"Clone"
"Copy"
"Debug"
"Default"
"Eq"
"Hash"
"Ord"
"PartialEq"
"PartialOrd"
"ToOwned"
"Box"
"String"
"ToString"
"Vec"
"FromIterator"
"TryFrom"
"TryInto"))

; ---
; Punctuation
; ---
Expand Down

0 comments on commit f9aae99

Please sign in to comment.