From 0546273570710b97e9eebfff84298afbbb372f02 Mon Sep 17 00:00:00 2001 From: Pedro Fedricci Date: Mon, 15 Apr 2024 13:07:15 -0300 Subject: [PATCH] chore: update tree-sitter-rust to v0.21.0 (#10365) * chore: update tree-sitter-rust to 0.21.0 * fix: pretty print and textobject tests --- helix-core/src/syntax.rs | 11 ++++++----- languages.toml | 2 +- runtime/queries/rust/highlights.scm | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 78abc0b0a..3cf818f60 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -2765,10 +2765,10 @@ fn test_textobject_queries() { ) }; - test("quantified_nodes", 1..36); + test("quantified_nodes", 1..37); // NOTE: Enable after implementing proper node group capturing - // test("quantified_nodes_grouped", 1..36); - // test("multiple_nodes_grouped", 1..36); + // test("quantified_nodes_grouped", 1..37); + // test("multiple_nodes_grouped", 1..37); } #[test] @@ -2939,7 +2939,7 @@ fn assert_pretty_print( #[test] fn test_pretty_print() { - let source = r#"/// Hello"#; + let source = r#"// Hello"#; assert_pretty_print("rust", source, "(line_comment)", 0, source.len()); // A large tree should be indented with fields: @@ -2958,7 +2958,8 @@ fn test_pretty_print() { " (macro_invocation\n", " macro: (identifier)\n", " (token_tree\n", - " (string_literal))))))", + " (string_literal\n", + " (string_content)))))))", ), 0, source.len(), diff --git a/languages.toml b/languages.toml index 1a345add9..ea1607d84 100644 --- a/languages.toml +++ b/languages.toml @@ -250,7 +250,7 @@ args = { attachCommands = [ "platform select remote-gdb-server", "platform conne [[grammar]] name = "rust" -source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0431a2c60828731f27491ee9fdefe25e250ce9c9" } +source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "473634230435c18033384bebaa6d6a17c2523281" } [[language]] name = "sway" diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 09068b4f5..1c0f799b1 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -51,7 +51,7 @@ (lifetime "'" @label (identifier) @label) -(loop_label +(label "'" @label (identifier) @label)