From f9aae99379e4b0906cf18ca86a076310e7c857ef Mon Sep 17 00:00:00 2001 From: Frans Skarman Date: Wed, 14 Aug 2024 17:43:31 +0000 Subject: [PATCH] Highlight types and enum members in the rust prelude (#8535) * Add some rust builtins * rust queries: Add everything in the 2021 prelude * Update runtime/queries/rust/highlights.scm Co-authored-by: Michael Davis --------- Co-authored-by: Michael Davis --- runtime/queries/rust/highlights.scm | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 7997c5ea0bdb..2981075fb07c 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -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 ; ---