Revert "lsp: Parse LSP messages on background thread - again (#23122)" (#23301)

This reverts commit 1b3b825c7f.

When debugging git diffs we found that this introduced a re-ordering of
messages sent to the LSP:

* User hits "format"
* Zed adjusts spacing, and sends "spaces changed" to the LSP
* Zed sends "format" to LSP

With the async approach here, the format request can now arrive before
the space changed request.

You can reproduce this with `test_strip_whitespace_and_format_via_lsp`
under some conditions.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-01-17 15:06:10 -07:00 committed by GitHub
parent 0dda9851b3
commit a247617d6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 62 additions and 83 deletions

View file

@ -315,12 +315,12 @@ impl EditorLspTestContext {
pub fn handle_request<T, F, Fut>(
&self,
handler: F,
mut handler: F,
) -> futures::channel::mpsc::UnboundedReceiver<()>
where
T: 'static + request::Request,
T::Params: 'static + Send,
F: 'static + Send + Sync + Fn(lsp::Url, T::Params, gpui::AsyncAppContext) -> Fut,
F: 'static + Send + FnMut(lsp::Url, T::Params, gpui::AsyncAppContext) -> Fut,
Fut: 'static + Send + Future<Output = Result<T::Result>>,
{
let url = self.buffer_lsp_url.clone();