mirror of https://github.com/helix-editor/helix
Update tree-house and bindings to v0.2.0
parent
637274c4d4
commit
7410fe35a3
|
@ -2800,9 +2800,9 @@ checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076"
|
|||
|
||||
[[package]]
|
||||
name = "tree-house"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "803311306ba3279e87699f7fa16ea18fbcc8889d0ff0c20dc0652317f8b58117"
|
||||
checksum = "679e3296e503901cd9f6e116be5a43a9270222215bf6c78b4b1f4af5c3dcc62d"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"hashbrown 0.15.3",
|
||||
|
@ -2817,9 +2817,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tree-house-bindings"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bec701469c18312edc48d0a29e29987d0359c8b1fff1e1f718da5815b9f5b0e"
|
||||
checksum = "690809022f44e3d2329882649724b6e0027ade3fada65e4631d303e744dc32b4"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libloading",
|
||||
|
|
|
@ -37,7 +37,7 @@ package.helix-tui.opt-level = 2
|
|||
package.helix-term.opt-level = 2
|
||||
|
||||
[workspace.dependencies]
|
||||
tree-house = { version = "0.1.0", default-features = false }
|
||||
tree-house = { version = "0.2.0", default-features = false }
|
||||
nucleo = "0.5.0"
|
||||
slotmap = "1.0.7"
|
||||
thiserror = "2.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::{borrow::Cow, collections::HashMap, iter};
|
||||
|
||||
use helix_stdx::rope::RopeSliceExt;
|
||||
use tree_house::TREE_SITTER_MATCH_LIMIT;
|
||||
|
||||
use crate::{
|
||||
chars::{char_is_line_ending, char_is_whitespace},
|
||||
|
@ -629,9 +630,7 @@ fn query_indents<'a>(
|
|||
let mut indent_captures: HashMap<usize, Vec<IndentCapture>> = HashMap::new();
|
||||
let mut extend_captures: HashMap<usize, Vec<ExtendCapture>> = HashMap::new();
|
||||
|
||||
let mut cursor = InactiveQueryCursor::new();
|
||||
cursor.set_byte_range(range);
|
||||
let mut cursor = cursor.execute_query(
|
||||
let mut cursor = InactiveQueryCursor::new(range, TREE_SITTER_MATCH_LIMIT).execute_query(
|
||||
&query.query,
|
||||
&syntax.tree().root_node(),
|
||||
RopeInput::new(text),
|
||||
|
|
|
@ -864,12 +864,8 @@ impl TextObjectQuery {
|
|||
.iter()
|
||||
.find_map(|cap| self.query.get_capture(cap))?;
|
||||
|
||||
let mut cursor = InactiveQueryCursor::new();
|
||||
// TODO: this line can be dropped when we update tree-house to automatically reset cursors
|
||||
// back to defaults when reusing them from the cursor cache.
|
||||
cursor.set_byte_range(0..u32::MAX);
|
||||
cursor.set_match_limit(TREE_SITTER_MATCH_LIMIT);
|
||||
let mut cursor = cursor.execute_query(&self.query, node, RopeInput::new(slice));
|
||||
let mut cursor = InactiveQueryCursor::new(0..u32::MAX, TREE_SITTER_MATCH_LIMIT)
|
||||
.execute_query(&self.query, node, RopeInput::new(slice));
|
||||
let capture_node = iter::from_fn(move || {
|
||||
let (mat, _) = cursor.next_matched_node()?;
|
||||
Some(mat.nodes_for_capture(capture).cloned().collect())
|
||||
|
|
Loading…
Reference in New Issue