mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +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);
|
||||
return cx.spawn(|this, cx| async move {
|
||||
let response = rpc.request(message).await?;
|
||||
if this.read_with(&cx, |this, _| this.is_read_only()) {
|
||||
Err(anyhow!("disconnected before completing request"))
|
||||
} else {
|
||||
request
|
||||
.response_from_proto(response, this, buffer_handle, cx)
|
||||
.await
|
||||
}
|
||||
});
|
||||
}
|
||||
Task::ready(Ok(Default::default()))
|
||||
|
|
Loading…
Reference in a new issue