From 600bdae69fb1c433f5496f891ba39fc961227f8b Mon Sep 17 00:00:00 2001 From: Nik Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Thu, 15 May 2025 17:18:13 +0100 Subject: [PATCH] chore: update to new version of my PR to tree-sitter --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- helix-core/src/comment.rs | 1 + helix-core/src/syntax.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49454d6aa..0bfe42dba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2801,7 +2801,7 @@ checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" [[package]] name = "tree-house" version = "0.1.0" -source = "git+https://github.com/nik-rev/tree-house?rev=5d24d0014336342e3b2c3456df0c26e8ee602101#5d24d0014336342e3b2c3456df0c26e8ee602101" +source = "git+https://github.com/nik-rev/tree-house?rev=ae033326f7c5355f2fb8673cefc579ffcb92f508#ae033326f7c5355f2fb8673cefc579ffcb92f508" dependencies = [ "arc-swap", "hashbrown 0.15.2", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "tree-house-bindings" version = "0.1.0" -source = "git+https://github.com/nik-rev/tree-house?rev=5d24d0014336342e3b2c3456df0c26e8ee602101#5d24d0014336342e3b2c3456df0c26e8ee602101" +source = "git+https://github.com/nik-rev/tree-house?rev=ae033326f7c5355f2fb8673cefc579ffcb92f508#ae033326f7c5355f2fb8673cefc579ffcb92f508" dependencies = [ "cc", "libloading", diff --git a/Cargo.toml b/Cargo.toml index 74f3142f3..f9fe2d032 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ package.helix-tui.opt-level = 2 package.helix-term.opt-level = 2 [workspace.dependencies] -tree-house = { git = "https://github.com/nik-rev/tree-house", rev = "5d24d0014336342e3b2c3456df0c26e8ee602101", default-features = false } +tree-house = { git = "https://github.com/nik-rev/tree-house", rev = "ae033326f7c5355f2fb8673cefc579ffcb92f508", default-features = false } nucleo = "0.5.0" slotmap = "1.0.7" thiserror = "2.0" diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs index 0c0c374aa..f0b98c5a2 100644 --- a/helix-core/src/comment.rs +++ b/helix-core/src/comment.rs @@ -57,6 +57,7 @@ pub fn get_injected_tokens( .and_then(|syntax| { syntax .layers_for_byte_range(start, end) + .collect::>() .into_iter() .rev() .find_map(|layer| { diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index da408cd82..678f772a0 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -450,7 +450,7 @@ impl Syntax { self.inner.layer_for_byte_range(start, end) } - pub fn layers_for_byte_range(&self, start: u32, end: u32) -> Vec { + pub fn layers_for_byte_range(&self, start: u32, end: u32) -> impl Iterator + use<'_> { self.inner.layers_for_byte_range(start, end) }