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
co-authored by Antonio Scandurra
parent ae415ee49b
commit 80d55fd3d8
+3
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()