update initialize project call to accomodate for test scenarios

Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
KCaverly 2023-08-24 13:46:43 +02:00
parent 0b204bfdc8
commit a892a51ec3

View file

@ -65,7 +65,7 @@ pub fn init(
let project = workspace.read(cx).project().clone(); let project = workspace.read(cx).project().clone();
if project.read(cx).is_local() { if project.read(cx).is_local() {
semantic_index.update(cx, |index, cx| { 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, &mut self,
project: ModelHandle<Project>, project: ModelHandle<Project>,
cx: &mut ModelContext<Self>, cx: &mut ModelContext<Self>,
) { ) -> Task<Result<()>> {
let worktree_scans_complete = project let worktree_scans_complete = project
.read(cx) .read(cx)
.worktrees(cx) .worktrees(cx)
@ -931,10 +931,8 @@ impl SemanticIndex {
this.projects.insert(project.downgrade(), project_state); this.projects.insert(project.downgrade(), project_state);
}); });
Result::<(), _>::Ok(())
cx.background().spawn(async move { anyhow::Ok(()) }).await
}) })
.detach_and_log_err(cx)
} }
pub fn index_project( pub fn index_project(