Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

update semantic search to go to no results if search query is blank

KCaverlycf5d1d91a44e
diff --git a/crates/semantic_index/src/semantic_index.rs b/crates/semantic_index/src/semantic_index.rs
index 2ef409eb92c..0e18c420491 100644
--- a/crates/semantic_index/src/semantic_index.rs
+++ b/crates/semantic_index/src/semantic_index.rs
@@ -703,6 +703,10 @@ impl SemanticIndex {
let database =
VectorDatabase::new(fs.clone(), db_path.clone(), cx.background()).await?;
+ if phrase.len() == 0 {
+ return Ok(Vec::new());
+ }
+
let phrase_embedding = embedding_provider
.embed_batch(vec![phrase])
.await?