chore: Move a few more tasks into background_spawn (#35374)
Release Notes: - N/A
This commit is contained in:
parent
bb1a7ccbba
commit
296bb66b65
2 changed files with 18 additions and 18 deletions
|
@ -4911,7 +4911,7 @@ impl LspStore {
|
||||||
language_server_id: server_id.0 as u64,
|
language_server_id: server_id.0 as u64,
|
||||||
hint: Some(InlayHints::project_to_proto_hint(hint.clone())),
|
hint: Some(InlayHints::project_to_proto_hint(hint.clone())),
|
||||||
};
|
};
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let response = upstream_client
|
let response = upstream_client
|
||||||
.request(request)
|
.request(request)
|
||||||
.await
|
.await
|
||||||
|
@ -5125,7 +5125,7 @@ impl LspStore {
|
||||||
trigger,
|
trigger,
|
||||||
version: serialize_version(&buffer.read(cx).version()),
|
version: serialize_version(&buffer.read(cx).version()),
|
||||||
};
|
};
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
client
|
client
|
||||||
.request(request)
|
.request(request)
|
||||||
.await?
|
.await?
|
||||||
|
@ -5284,7 +5284,7 @@ impl LspStore {
|
||||||
GetDefinitions { position },
|
GetDefinitions { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(definitions_task
|
Ok(definitions_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -5357,7 +5357,7 @@ impl LspStore {
|
||||||
GetDeclarations { position },
|
GetDeclarations { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(declarations_task
|
Ok(declarations_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -5430,7 +5430,7 @@ impl LspStore {
|
||||||
GetTypeDefinitions { position },
|
GetTypeDefinitions { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(type_definitions_task
|
Ok(type_definitions_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -5503,7 +5503,7 @@ impl LspStore {
|
||||||
GetImplementations { position },
|
GetImplementations { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(implementations_task
|
Ok(implementations_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -5576,7 +5576,7 @@ impl LspStore {
|
||||||
GetReferences { position },
|
GetReferences { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(references_task
|
Ok(references_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -5660,7 +5660,7 @@ impl LspStore {
|
||||||
},
|
},
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(all_actions_task
|
Ok(all_actions_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -6854,7 +6854,7 @@ impl LspStore {
|
||||||
} else {
|
} else {
|
||||||
let document_colors_task =
|
let document_colors_task =
|
||||||
self.request_multiple_lsp_locally(buffer, None::<usize>, GetDocumentColor, cx);
|
self.request_multiple_lsp_locally(buffer, None::<usize>, GetDocumentColor, cx);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
Ok(document_colors_task
|
Ok(document_colors_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -6933,7 +6933,7 @@ impl LspStore {
|
||||||
GetSignatureHelp { position },
|
GetSignatureHelp { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
all_actions_task
|
all_actions_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -7010,7 +7010,7 @@ impl LspStore {
|
||||||
GetHover { position },
|
GetHover { position },
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
all_actions_task
|
all_actions_task
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -8013,7 +8013,7 @@ impl LspStore {
|
||||||
})
|
})
|
||||||
.collect::<FuturesUnordered<_>>();
|
.collect::<FuturesUnordered<_>>();
|
||||||
|
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let mut responses = Vec::with_capacity(response_results.len());
|
let mut responses = Vec::with_capacity(response_results.len());
|
||||||
while let Some((server_id, response_result)) = response_results.next().await {
|
while let Some((server_id, response_result)) = response_results.next().await {
|
||||||
if let Some(response) = response_result.log_err() {
|
if let Some(response) = response_result.log_err() {
|
||||||
|
|
|
@ -3372,7 +3372,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.definitions(buffer, position, cx)
|
lsp_store.definitions(buffer, position, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
@ -3390,7 +3390,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.declarations(buffer, position, cx)
|
lsp_store.declarations(buffer, position, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
@ -3408,7 +3408,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.type_definitions(buffer, position, cx)
|
lsp_store.type_definitions(buffer, position, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
@ -3426,7 +3426,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.implementations(buffer, position, cx)
|
lsp_store.implementations(buffer, position, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
@ -3444,7 +3444,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.references(buffer, position, cx)
|
lsp_store.references(buffer, position, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
@ -3996,7 +3996,7 @@ impl Project {
|
||||||
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.request_lsp(buffer_handle, server, request, cx)
|
lsp_store.request_lsp(buffer_handle, server, request, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(async move |_, _| {
|
cx.background_spawn(async move {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
drop(guard);
|
drop(guard);
|
||||||
result
|
result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue