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]] [[package]]
name = "tree-sitter" name = "tree-sitter"
version = "0.20.8" 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 = [ dependencies = [
"cc", "cc",
"regex", "regex",

View File

@ -4,7 +4,7 @@ default-members = ["crates/zed"]
resolver = "2" resolver = "2"
[patch.crates-io] [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" } 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 # 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); layer.tree.edit(&tree_edit);
if edit.new.start.0 < start_byte { if edit.new.start.0 < start_byte {
break; 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); layers.push(layer, text);
cursor.next(text); cursor.next(text);
} }

View File

@ -2435,7 +2435,7 @@ impl ToOffset for PointUtf16 {
impl ToOffset for usize { impl ToOffset for usize {
fn to_offset<'a>(&self, snapshot: &BufferSnapshot) -> 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 *self
} }
} }