chore: Fix sum_tree API changes. (#1286)

https://github.com/zed-industries/zed/pull/38776
This commit is contained in:
Jason Lee 2025-09-25 10:41:37 +08:00 committed by GitHub
parent 5aaf8c6a66
commit 8f5bff61fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 26 deletions

36
Cargo.lock generated
View file

@ -757,7 +757,7 @@ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"cexpr", "cexpr",
"clang-sys", "clang-sys",
"itertools 0.12.1", "itertools 0.11.0",
"lazy_static", "lazy_static",
"lazycell", "lazycell",
"log", "log",
@ -780,7 +780,7 @@ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"cexpr", "cexpr",
"clang-sys", "clang-sys",
"itertools 0.13.0", "itertools 0.11.0",
"log", "log",
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
@ -1449,7 +1449,7 @@ dependencies = [
[[package]] [[package]]
name = "collections" name = "collections"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"indexmap 2.10.0", "indexmap 2.10.0",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
@ -1918,7 +1918,7 @@ dependencies = [
[[package]] [[package]]
name = "derive_refineable" name = "derive_refineable"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -3112,7 +3112,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui" name = "gpui"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"as-raw-xcb-connection", "as-raw-xcb-connection",
@ -3297,7 +3297,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui_macros" name = "gpui_macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
@ -3566,7 +3566,7 @@ dependencies = [
[[package]] [[package]]
name = "http_client" name = "http_client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -3586,7 +3586,7 @@ dependencies = [
[[package]] [[package]]
name = "http_client_tls" name = "http_client_tls"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"rustls", "rustls",
"rustls-platform-verifier", "rustls-platform-verifier",
@ -3690,7 +3690,7 @@ dependencies = [
"js-sys", "js-sys",
"log", "log",
"wasm-bindgen", "wasm-bindgen",
"windows-core 0.61.2", "windows-core 0.58.0",
] ]
[[package]] [[package]]
@ -4544,7 +4544,7 @@ dependencies = [
[[package]] [[package]]
name = "media" name = "media"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bindgen 0.71.1", "bindgen 0.71.1",
@ -4980,7 +4980,7 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d"
dependencies = [ dependencies = [
"proc-macro-crate 3.3.0", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.105", "syn 2.0.105",
@ -5602,7 +5602,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]] [[package]]
name = "perf" name = "perf"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"collections", "collections",
"serde", "serde",
@ -6519,7 +6519,7 @@ dependencies = [
[[package]] [[package]]
name = "refineable" name = "refineable"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"derive_refineable", "derive_refineable",
"workspace-hack", "workspace-hack",
@ -6672,7 +6672,7 @@ dependencies = [
[[package]] [[package]]
name = "reqwest_client" name = "reqwest_client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -7257,7 +7257,7 @@ checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749"
[[package]] [[package]]
name = "semantic_version" name = "semantic_version"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"serde", "serde",
@ -7900,7 +7900,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]] [[package]]
name = "sum_tree" name = "sum_tree"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"log", "log",
@ -9216,7 +9216,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "util" name = "util"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-fs 2.1.3", "async-fs 2.1.3",
@ -9251,7 +9251,7 @@ dependencies = [
[[package]] [[package]]
name = "util_macros" name = "util_macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zed-industries/zed.git#4532765ae845b8c98c73c88cc916f7d771b429d5" source = "git+https://github.com/zed-industries/zed.git#17e55daf6f43b6e902d63320daed3154d6e22026"
dependencies = [ dependencies = [
"perf", "perf",
"quote", "quote",

View file

@ -211,8 +211,8 @@ impl sum_tree::Item for DiagnosticEntry {
} }
impl sum_tree::Summary for DiagnosticSummary { impl sum_tree::Summary for DiagnosticSummary {
type Context = (); type Context<'a> = &'a ();
fn zero(_: &Self::Context) -> Self { fn zero(_: Self::Context<'_>) -> Self {
DiagnosticSummary { DiagnosticSummary {
count: 0, count: 0,
start: usize::MIN, start: usize::MIN,
@ -220,7 +220,7 @@ impl sum_tree::Summary for DiagnosticSummary {
} }
} }
fn add_summary(&mut self, other: &Self, _: &Self::Context) { fn add_summary(&mut self, other: &Self, _: Self::Context<'_>) {
self.start = other.start; self.start = other.start;
self.end = other.end; self.end = other.end;
self.count += other.count; self.count += other.count;
@ -240,7 +240,7 @@ impl SeekTarget<'_, DiagnosticSummary, DiagnosticSummary> for usize {
} }
} }
#[derive(Debug, Clone, Default)] #[derive(Debug, Clone)]
pub struct DiagnosticSet { pub struct DiagnosticSet {
text: Rope, text: Rope,
diagnostics: SumTree<DiagnosticEntry>, diagnostics: SumTree<DiagnosticEntry>,

View file

@ -114,8 +114,8 @@ impl sum_tree::Item for HighlightItem {
} }
impl sum_tree::Summary for HighlightSummary { impl sum_tree::Summary for HighlightSummary {
type Context = (); type Context<'a> = &'a ();
fn zero(_: &Self::Context) -> Self { fn zero(_: Self::Context<'_>) -> Self {
HighlightSummary { HighlightSummary {
count: 0, count: 0,
start: usize::MIN, start: usize::MIN,
@ -125,7 +125,7 @@ impl sum_tree::Summary for HighlightSummary {
} }
} }
fn add_summary(&mut self, other: &Self, _: &Self::Context) { fn add_summary(&mut self, other: &Self, _: Self::Context<'_>) {
self.min_start = self.min_start.min(other.min_start); self.min_start = self.min_start.min(other.min_start);
self.max_end = self.max_end.max(other.max_end); self.max_end = self.max_end.max(other.max_end);
self.start = other.start; self.start = other.start;

View file

@ -452,7 +452,7 @@ impl InputState {
language, language,
highlighter: Rc::new(RefCell::new(None)), highlighter: Rc::new(RefCell::new(None)),
line_number: true, line_number: true,
diagnostics: DiagnosticSet::default(), diagnostics: DiagnosticSet::new(&Rope::new()),
}; };
self.searchable = true; self.searchable = true;
self self