From dca235c5c8f94bc9d2646d1be303d0968a54201e Mon Sep 17 00:00:00 2001 From: Rock Boynton <rock.boynton@yahoo.com> Date: Thu, 23 Jan 2025 11:11:07 -0800 Subject: [PATCH] Update `tree-sitter-rust` (#12607) Co-authored-by: Rock Boynton <rboynton@anduril.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --- languages.toml | 2 +- runtime/queries/rust/highlights.scm | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/languages.toml b/languages.toml index 84a0783e..4cc5ddec 100644 --- a/languages.toml +++ b/languages.toml @@ -298,7 +298,7 @@ args = { attachCommands = [ "platform select remote-gdb-server", "platform conne [[grammar]] name = "rust" -source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "9c84af007b0f144954adb26b3f336495cbb320a7" } +source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "1f63b33efee17e833e0ea29266dd3d713e27e321" } [[language]] name = "sway" diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 898bde6a..89449202 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -174,8 +174,7 @@ (for_expression "for" @keyword.control.repeat) -((identifier) @keyword.control - (#match? @keyword.control "^yield$")) +(gen_block "gen" @keyword.control) "in" @keyword.control @@ -196,6 +195,7 @@ "continue" "return" "await" + "yield" ] @keyword.control.return "use" @keyword.control.import @@ -204,6 +204,10 @@ (type_cast_expression "as" @keyword.operator) +((generic_type + type: (type_identifier) @keyword) + (#eq? @keyword "use")) + [ (crate) (super) @@ -241,6 +245,7 @@ [ "static" "const" + "raw" "ref" "move" "dyn"