Merge pull request #765 from zed-industries/yield-lsp

Don't starve UI thread when rapidly receiving LSP messages
This commit is contained in:
Antonio Scandurra 2022-04-07 17:15:19 +02:00 committed by GitHub
commit 0b8eed64ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,9 @@ impl LanguageServer {
std::str::from_utf8(&buffer)?
));
}
// Don't starve the main thread when receiving lots of messages at once.
smol::future::yield_now().await;
}
}
.log_err()