From a892a51ec30bf9b6dec54399615e835528dfdac8 Mon Sep 17 00:00:00 2001 From: KCaverly Date: Thu, 24 Aug 2023 13:46:43 +0200 Subject: [PATCH] update initialize project call to accomodate for test scenarios Co-authored-by: Piotr --- crates/semantic_index/src/semantic_index.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/semantic_index/src/semantic_index.rs b/crates/semantic_index/src/semantic_index.rs index fed320becdc3ef3bc0e7c5ce84632e0536283070..4f932b0622c7da8d4102f636f6bd833f08dff2a1 100644 --- a/crates/semantic_index/src/semantic_index.rs +++ b/crates/semantic_index/src/semantic_index.rs @@ -65,7 +65,7 @@ pub fn init( let project = workspace.read(cx).project().clone(); if project.read(cx).is_local() { semantic_index.update(cx, |index, cx| { - index.initialize_project(project, cx); + index.initialize_project(project, cx).detach_and_log_err(cx) }); } } @@ -785,7 +785,7 @@ impl SemanticIndex { &mut self, project: ModelHandle, cx: &mut ModelContext, - ) { + ) -> Task> { let worktree_scans_complete = project .read(cx) .worktrees(cx) @@ -931,10 +931,8 @@ impl SemanticIndex { this.projects.insert(project.downgrade(), project_state); }); - - cx.background().spawn(async move { anyhow::Ok(()) }).await + Result::<(), _>::Ok(()) }) - .detach_and_log_err(cx) } pub fn index_project(