mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 12:19:28 +00:00
Upgrade Tree-sitter for error recovery bug fix (#2860)
Bumps Tree-sitter for https://github.com/tree-sitter/tree-sitter/pull/2526. Release Notes: - Fixed a bug where small syntax errors would mess up syntax highlighting more than necessary when editing certain languages, like Scheme and PHP.
This commit is contained in:
commit
08429169e2
3 changed files with 8 additions and 6 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -8126,7 +8126,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tree-sitter"
|
name = "tree-sitter"
|
||||||
version = "0.20.10"
|
version = "0.20.10"
|
||||||
source = "git+https://github.com/tree-sitter/tree-sitter?rev=1c65ca24bc9a734ab70115188f465e12eecf224e#1c65ca24bc9a734ab70115188f465e12eecf224e"
|
source = "git+https://github.com/tree-sitter/tree-sitter?rev=35a6052fbcafc5e5fc0f9415b8652be7dcaf7222#35a6052fbcafc5e5fc0f9415b8652be7dcaf7222"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"regex",
|
"regex",
|
||||||
|
|
|
@ -135,7 +135,7 @@ tree-sitter-lua = "0.0.14"
|
||||||
tree-sitter-nix = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "66e3e9ce9180ae08fc57372061006ef83f0abde7" }
|
tree-sitter-nix = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "66e3e9ce9180ae08fc57372061006ef83f0abde7" }
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "1c65ca24bc9a734ab70115188f465e12eecf224e" }
|
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "35a6052fbcafc5e5fc0f9415b8652be7dcaf7222" }
|
||||||
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
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub struct SyntaxMapMatch<'a> {
|
||||||
|
|
||||||
struct SyntaxMapCapturesLayer<'a> {
|
struct SyntaxMapCapturesLayer<'a> {
|
||||||
depth: usize,
|
depth: usize,
|
||||||
captures: QueryCaptures<'a, 'a, TextProvider<'a>>,
|
captures: QueryCaptures<'a, 'a, TextProvider<'a>, &'a [u8]>,
|
||||||
next_capture: Option<QueryCapture<'a>>,
|
next_capture: Option<QueryCapture<'a>>,
|
||||||
grammar_index: usize,
|
grammar_index: usize,
|
||||||
_query_cursor: QueryCursorHandle,
|
_query_cursor: QueryCursorHandle,
|
||||||
|
@ -83,7 +83,7 @@ struct SyntaxMapMatchesLayer<'a> {
|
||||||
next_pattern_index: usize,
|
next_pattern_index: usize,
|
||||||
next_captures: Vec<QueryCapture<'a>>,
|
next_captures: Vec<QueryCapture<'a>>,
|
||||||
has_next: bool,
|
has_next: bool,
|
||||||
matches: QueryMatches<'a, 'a, TextProvider<'a>>,
|
matches: QueryMatches<'a, 'a, TextProvider<'a>, &'a [u8]>,
|
||||||
grammar_index: usize,
|
grammar_index: usize,
|
||||||
_query_cursor: QueryCursorHandle,
|
_query_cursor: QueryCursorHandle,
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1279,9 @@ fn get_injections(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (language, mut included_ranges) in combined_injection_ranges.drain() {
|
for (language, mut included_ranges) in combined_injection_ranges.drain() {
|
||||||
included_ranges.sort_unstable();
|
included_ranges.sort_unstable_by(|a, b| {
|
||||||
|
Ord::cmp(&a.start_byte, &b.start_byte).then_with(|| Ord::cmp(&a.end_byte, &b.end_byte))
|
||||||
|
});
|
||||||
queue.push(ParseStep {
|
queue.push(ParseStep {
|
||||||
depth,
|
depth,
|
||||||
language: ParseStepLanguage::Loaded { language },
|
language: ParseStepLanguage::Loaded { language },
|
||||||
|
@ -1697,7 +1699,7 @@ impl std::fmt::Debug for SyntaxLayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> tree_sitter::TextProvider<'a> for TextProvider<'a> {
|
impl<'a> tree_sitter::TextProvider<&'a [u8]> for TextProvider<'a> {
|
||||||
type I = ByteChunks<'a>;
|
type I = ByteChunks<'a>;
|
||||||
|
|
||||||
fn text(&mut self, node: tree_sitter::Node) -> Self::I {
|
fn text(&mut self, node: tree_sitter::Node) -> Self::I {
|
||||||
|
|
Loading…
Reference in a new issue