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:
parent
0dda9851b3
commit
a247617d6f
3 changed files with 62 additions and 83 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue