mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-29 21:49:33 +00:00
Wait to see guest's buffer version before converting completion anchor
This commit is contained in:
parent
4a61e2dfa4
commit
8020ea783f
1 changed files with 6 additions and 6 deletions
|
@ -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?;
|
||||
|
|
Loading…
Reference in a new issue