Re-request incomplete remote buffers when syncing buffers

Any buffers we requested but that haven't been fully sent will cause
outstainding open requests to hang. If we re-request them, any
waiting open requests will resume when the requested buffers finish
being created.

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Nathan Sobo 2023-01-04 16:00:43 -07:00
parent 1006ada458
commit 7a629769b7
2 changed files with 68 additions and 29 deletions

View file

@ -524,7 +524,7 @@ async fn location_links_from_proto(
Some(origin) => {
let buffer = project
.update(&mut cx, |this, cx| {
this.wait_for_buffer(origin.buffer_id, cx)
this.wait_for_remote_buffer(origin.buffer_id, cx)
})
.await?;
let start = origin
@ -549,7 +549,7 @@ async fn location_links_from_proto(
let target = link.target.ok_or_else(|| anyhow!("missing target"))?;
let buffer = project
.update(&mut cx, |this, cx| {
this.wait_for_buffer(target.buffer_id, cx)
this.wait_for_remote_buffer(target.buffer_id, cx)
})
.await?;
let start = target
@ -814,7 +814,7 @@ impl LspCommand for GetReferences {
for location in message.locations {
let target_buffer = project
.update(&mut cx, |this, cx| {
this.wait_for_buffer(location.buffer_id, cx)
this.wait_for_remote_buffer(location.buffer_id, cx)
})
.await?;
let start = location