Wait to see guest's buffer version before converting completion anchor

This commit is contained in:
Antonio Scandurra 2023-04-06 16:23:10 +02:00
parent 4a61e2dfa4
commit 8020ea783f

View file

@ -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?;