From 4b3bb2c6611eda1eed0ba88e9d3ef731f1439a62 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 11 Jul 2023 15:02:43 -0700 Subject: [PATCH] Define semantic search action regardless of whether the feature is enabled --- crates/vector_store/src/vector_store.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/vector_store/src/vector_store.rs b/crates/vector_store/src/vector_store.rs index d3f89d568a..87e70230ee 100644 --- a/crates/vector_store/src/vector_store.rs +++ b/crates/vector_store/src/vector_store.rs @@ -44,14 +44,7 @@ pub fn init( language_registry: Arc, cx: &mut AppContext, ) { - if *RELEASE_CHANNEL == ReleaseChannel::Stable { - return; - } - settings::register::(cx); - if !settings::get::(cx).enable { - return; - } let db_file_path = EMBEDDINGS_DIR .join(Path::new(RELEASE_CHANNEL_NAME.as_str())) @@ -60,8 +53,6 @@ pub fn init( SemanticSearch::init(cx); cx.add_action( |workspace: &mut Workspace, _: &Toggle, cx: &mut ViewContext| { - eprintln!("semantic_search::Toggle action"); - if cx.has_global::>() { let vector_store = cx.global::>().clone(); workspace.toggle_modal(cx, |workspace, cx| { @@ -78,6 +69,12 @@ pub fn init( }, ); + if *RELEASE_CHANNEL == ReleaseChannel::Stable + || !settings::get::(cx).enable + { + return; + } + cx.spawn(move |mut cx| async move { let vector_store = VectorStore::new( fs,