mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-09 02:44:49 +00:00
Define semantic search action regardless of whether the feature is enabled
This commit is contained in:
parent
4a4dd39875
commit
4b3bb2c661
1 changed files with 6 additions and 9 deletions
|
@ -44,14 +44,7 @@ pub fn init(
|
|||
language_registry: Arc<LanguageRegistry>,
|
||||
cx: &mut AppContext,
|
||||
) {
|
||||
if *RELEASE_CHANNEL == ReleaseChannel::Stable {
|
||||
return;
|
||||
}
|
||||
|
||||
settings::register::<VectorStoreSettings>(cx);
|
||||
if !settings::get::<VectorStoreSettings>(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<Workspace>| {
|
||||
eprintln!("semantic_search::Toggle action");
|
||||
|
||||
if cx.has_global::<ModelHandle<VectorStore>>() {
|
||||
let vector_store = cx.global::<ModelHandle<VectorStore>>().clone();
|
||||
workspace.toggle_modal(cx, |workspace, cx| {
|
||||
|
@ -78,6 +69,12 @@ pub fn init(
|
|||
},
|
||||
);
|
||||
|
||||
if *RELEASE_CHANNEL == ReleaseChannel::Stable
|
||||
|| !settings::get::<VectorStoreSettings>(cx).enable
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cx.spawn(move |mut cx| async move {
|
||||
let vector_store = VectorStore::new(
|
||||
fs,
|
||||
|
|
Loading…
Reference in a new issue