reindex semantic index when search project pane is reactivated in semantic mode

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

View file

@ -1635,6 +1635,12 @@ impl ToolbarItemView for ProjectSearchBar {
self.subscription = None;
self.active_project_search = None;
if let Some(search) = active_pane_item.and_then(|i| i.downcast::<ProjectSearchView>()) {
search.update(cx, |search, cx| {
if search.current_mode == SearchMode::Semantic {
search.index_project(cx);
}
});
self.subscription = Some(cx.observe(&search, |_, _, cx| cx.notify()));
self.active_project_search = Some(search);
ToolbarItemLocation::PrimaryLeft {