Add labeled tasks to gpui and observe them in the activity status to give feedback when we are still waiting for the language server

This commit is contained in:
Kay Simmons 2023-02-20 01:22:08 -08:00
parent efafd1d8d3
commit 3564e95f27
4 changed files with 229 additions and 65 deletions

View file

@ -5066,7 +5066,7 @@ impl Editor {
GotoDefinitionKind::Type => project.type_definition(&buffer, head, cx),
});
cx.spawn(|workspace, mut cx| async move {
cx.spawn_labeled("Fetching Definition...", |workspace, mut cx| async move {
let definitions = definitions.await?;
workspace.update(&mut cx, |workspace, cx| {
Editor::navigate_to_definitions(workspace, editor_handle, definitions, cx);
@ -5146,7 +5146,7 @@ impl Editor {
let project = workspace.project().clone();
let references = project.update(cx, |project, cx| project.references(&buffer, head, cx));
Some(cx.spawn(|workspace, mut cx| async move {
Some(cx.spawn_labeled("Finding All References...", |workspace, mut cx| async move {
let locations = references.await?;
if locations.is_empty() {
return Ok(());