Update to latest tree-sitter commit

This is needed for https://github.com/tree-sitter/tree-sitter/pull/1845
This commit is contained in:
Max Brunsfeld 2022-08-25 10:58:46 -07:00
parent 345b266dee
commit 1f12186e3c
4 changed files with 11 additions and 3 deletions

2
Cargo.lock generated
View file

@ -5842,7 +5842,7 @@ dependencies = [
[[package]]
name = "tree-sitter"
version = "0.20.8"
source = "git+https://github.com/tree-sitter/tree-sitter?rev=477b6677537e89c7bdff14ce84dad6d23a6415bb#477b6677537e89c7bdff14ce84dad6d23a6415bb"
source = "git+https://github.com/tree-sitter/tree-sitter?rev=366210ae925d7ea0891bc7a0c738f60c77c04d7b#366210ae925d7ea0891bc7a0c738f60c77c04d7b"
dependencies = [
"cc",
"regex",

View file

@ -4,7 +4,7 @@ default-members = ["crates/zed"]
resolver = "2"
[patch.crates-io]
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "477b6677537e89c7bdff14ce84dad6d23a6415bb" }
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "366210ae925d7ea0891bc7a0c738f60c77c04d7b" }
async-task = { git = "https://github.com/zed-industries/async-task", rev = "341b57d6de98cdfd7b418567b8de2022ca993a6e" }
# TODO - Remove when a version is released with this PR: https://github.com/servo/core-foundation-rs/pull/457

View file

@ -284,11 +284,19 @@ impl SyntaxSnapshot {
};
layer.tree.edit(&tree_edit);
if edit.new.start.0 < start_byte {
break;
}
}
debug_assert!(
layer.tree.root_node().end_byte() <= text.len(),
"tree's size {}, is larger than text size {}",
layer.tree.root_node().end_byte(),
text.len(),
);
layers.push(layer, text);
cursor.next(text);
}

View file

@ -2435,7 +2435,7 @@ impl ToOffset for PointUtf16 {
impl ToOffset for usize {
fn to_offset<'a>(&self, snapshot: &BufferSnapshot) -> usize {
assert!(*self <= snapshot.len(), "offset is out of range");
assert!(*self <= snapshot.len(), "offset {self} is out of range");
*self
}
}