Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP: failing randomized test
Antonio Scandurra6458a9144ea0
diff --git a/Cargo.lock b/Cargo.lockindex 1dfc4bc24ca..6debc9eb8af 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -4437,6 +4437,7 @@ dependencies = ["aho-corasick","anyhow","async-trait",+ "backtrace","client","clock","collections",diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.tomlindex dd4d2be5b68..6d6560ea384 100644--- a/crates/project/Cargo.toml+++ b/crates/project/Cargo.toml@@ -37,6 +37,7 @@ util = { path = "../util" }aho-corasick = "0.7"anyhow = "1.0.57"async-trait = "0.1"+backtrace = "0.3"futures = "0.3"ignore = "0.4"lazy_static = "1.4.0"diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex ca1b988d059..b09c1fd267e 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -4635,7 +4635,12 @@ impl Project {let is_host = collaborator.replica_id == 0;this.collaborators.insert(new_peer_id, collaborator);- if let Some(buffers) = this.shared_buffers.remove(&old_peer_id) {+ let buffers = this.shared_buffers.remove(&old_peer_id);+ println!(+ "peer {} became {}. moving buffers {:?}",+ old_peer_id, new_peer_id, &buffers+ );+ if let Some(buffers) = buffers {this.shared_buffers.insert(new_peer_id, buffers);}@@ -5610,6 +5615,13 @@ impl Project {) -> u64 {let buffer_id = buffer.read(cx).remote_id();if let Some(project_id) = self.remote_id() {+ if buffer_id == 300015 {+ println!(+ "creating buffer for peer {}. {:?}",+ peer_id,+ backtrace::Backtrace::new()+ );+ }let shared_buffers = self.shared_buffers.entry(peer_id).or_default();if shared_buffers.insert(buffer_id) {let buffer = buffer.read(cx);