mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 17:44:30 +00:00
After completing LSP request, return an error if guest is disconnected
This commit is contained in:
parent
b0e1d6bc7f
commit
5581674f8f
1 changed files with 7 additions and 3 deletions
|
@ -4109,9 +4109,13 @@ impl Project {
|
||||||
let message = request.to_proto(project_id, buffer);
|
let message = request.to_proto(project_id, buffer);
|
||||||
return cx.spawn(|this, cx| async move {
|
return cx.spawn(|this, cx| async move {
|
||||||
let response = rpc.request(message).await?;
|
let response = rpc.request(message).await?;
|
||||||
|
if this.read_with(&cx, |this, _| this.is_read_only()) {
|
||||||
|
Err(anyhow!("disconnected before completing request"))
|
||||||
|
} else {
|
||||||
request
|
request
|
||||||
.response_from_proto(response, this, buffer_handle, cx)
|
.response_from_proto(response, this, buffer_handle, cx)
|
||||||
.await
|
.await
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Task::ready(Ok(Default::default()))
|
Task::ready(Ok(Default::default()))
|
||||||
|
|
Loading…
Reference in a new issue