History

update initialize project call to accomodate for test scenarios

KCaverly committed 3 years ago

Commit a892a511 parent 0b204bf1 file · +3 −5Browse files

Unified · Split

crates/semantic_index/src/semantic_index.rs+3−5
@@ -65,7 +65,7 @@ pub fn init( · 64 unmodified lines
6565 let project = workspace.read(cx).project().clone();
6666 if project.read(cx).is_local() {
6767 semantic_index.update(cx, |index, cx| {
68− index.initialize_project(project, cx);
68+ index.initialize_project(project, cx).detach_and_log_err(cx)
6969 });
7070 }
7171 }
@@ -785,7 +785,7 @@ impl SemanticIndex { · 713 unmodified lines
785785 &mut self,
786786 project: ModelHandle<Project>,
787787 cx: &mut ModelContext<Self>,
788− ) {
788+ ) -> Task<Result<()>> {
789789 let worktree_scans_complete = project
790790 .read(cx)
791791 .worktrees(cx)
@@ -931,10 +931,8 @@ impl SemanticIndex { · 139 unmodified lines
931931
932932 this.projects.insert(project.downgrade(), project_state);
933933 });
934−
935− cx.background().spawn(async move { anyhow::Ok(()) }).await
934+ Result::<(), _>::Ok(())
936935 })
937− .detach_and_log_err(cx)
938936 }
939937
940938 pub fn index_project(

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t