From c96e1f1ecf965253302b287122fb00e79b17de6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 26 Oct 2023 15:58:10 +0900 Subject: [PATCH] Revert "Pin tree-sitter to the 0.20.10 release (#8396)" We only reverted so that the latest release would use a stable tree-sitter version hosted on crates.io. We do want the improvements on nightly. This reverts commit 2ebcc4dbeb306cc285d47bd1d21d72c7e57ecb72. --- Cargo.lock | 3 +-- Cargo.toml | 2 +- helix-core/src/syntax.rs | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d10cd16f6390..3a88401ed3fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2260,8 +2260,7 @@ dependencies = [ [[package]] name = "tree-sitter" version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +source = "git+https://github.com/tree-sitter/tree-sitter?rev=ab09ae20d640711174b8da8a654f6b3dec93da1a#ab09ae20d640711174b8da8a654f6b3dec93da1a" dependencies = [ "cc", "regex", diff --git a/Cargo.toml b/Cargo.toml index 7217cd3de1e6..8ffe0fa7ac84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,5 +35,5 @@ package.helix-tui.opt-level = 2 package.helix-term.opt-level = 2 [workspace.dependencies] -tree-sitter = { version = "0.20" } +tree-sitter = { version = "0.20", git = "https://github.com/tree-sitter/tree-sitter", rev = "ab09ae20d640711174b8da8a654f6b3dec93da1a" } nucleo = "0.2.0" diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 97a882249f3f..881b45098a9e 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1614,7 +1614,7 @@ impl<'a> Iterator for ChunksBytes<'a> { } pub struct RopeProvider<'a>(pub RopeSlice<'a>); -impl<'a> TextProvider<'a> for RopeProvider<'a> { +impl<'a> TextProvider<&'a [u8]> for RopeProvider<'a> { type I = ChunksBytes<'a>; fn text(&mut self, node: Node) -> Self::I { @@ -1628,7 +1628,7 @@ impl<'a> TextProvider<'a> for RopeProvider<'a> { struct HighlightIterLayer<'a> { _tree: Option, cursor: QueryCursor, - captures: RefCell>>>, + captures: RefCell, &'a [u8]>>>, config: &'a HighlightConfiguration, highlight_end_stack: Vec, scope_stack: Vec>,