Don't starve UI thread when rapidly receiving LSP messages

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Nathan Sobo 2022-04-07 08:30:42 -06:00
parent ae415ee49b
commit 80d55fd3d8

View file

@ -201,6 +201,9 @@ impl LanguageServer {
std::str::from_utf8(&buffer)? 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() .log_err()