Re-index project when a worktree is registered

Co-Authored-By: Kyle Caverly <kyle@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-09-05 17:17:58 +02:00
parent 3c70b127bd
commit 95b72a73ad
2 changed files with 24 additions and 52 deletions

View file

@ -87,14 +87,9 @@ async fn test_semantic_index(deterministic: Arc<Deterministic>, cx: &mut TestApp
let project = Project::test(fs.clone(), ["/the-root".as_ref()], cx).await;
semantic_index.update(cx, |store, cx| {
store.register_project(project.clone(), cx);
});
deterministic.run_until_parked();
semantic_index.update(cx, |store, cx| store.index_project(project.clone(), cx));
let pending_file_count =
semantic_index.read_with(cx, |index, _| index.pending_file_count(&project).unwrap());
semantic_index.update(cx, |store, cx| store.index_project(project.clone(), cx));
deterministic.run_until_parked();
assert_eq!(*pending_file_count.borrow(), 3);
deterministic.advance_clock(EMBEDDING_QUEUE_FLUSH_TIMEOUT);