move semantic search project intialization to a subscribe event for workspace created

Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
KCaverly 2023-08-24 13:14:19 +02:00
parent e8e7b294d8
commit a1519e4c38
2 changed files with 17 additions and 11 deletions

View file

@ -844,16 +844,6 @@ impl ProjectSearchView {
.detach();
let filters_enabled = false;
// Initialize Semantic Index if Needed
if SemanticIndex::enabled(cx) {
let model = model.read(cx);
project = model.project.clone();
SemanticIndex::global(cx).map(|semantic| {
dbg!("Initializing project");
semantic.update(cx, |this, cx| this.initialize_project(project.clone(), cx));
});
}
// Check if Worktrees have all been previously indexed
let mut this = ProjectSearchView {
search_id: model.read(cx).search_id,