Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Wait to see guest's buffer version before converting completion anchor
Antonio Scandurra8020ea783fc3
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 72f3d05cae5..a9cab023cd8 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -5550,6 +5550,12 @@ impl Project {.ok_or_else(|| anyhow!("unknown buffer id {}", envelope.payload.buffer_id))})?;+ let version = deserialize_version(envelope.payload.version);+ buffer+ .update(&mut cx, |buffer, _| buffer.wait_for_version(version))+ .await;+ let version = buffer.read_with(&cx, |buffer, _| buffer.version());+let position = envelope.payload.position@@ -5561,12 +5567,6 @@ impl Project {}).ok_or_else(|| anyhow!("invalid position"))?;- let version = deserialize_version(envelope.payload.version);- buffer- .update(&mut cx, |buffer, _| buffer.wait_for_version(version))- .await;- let version = buffer.read_with(&cx, |buffer, _| buffer.version());-let completions = this.update(&mut cx, |this, cx| this.completions(&buffer, position, cx)).await?;