Return an error from project index tool when embedding query fails (#11264)

Previously, a failure to embed the search query (due to a rate limit
error) would appear the same as if there were no results.

* Avoid repeatedly embedding the search query for each worktree
* Unify tasks for searching all worktree

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld 2024-05-01 12:15:44 -07:00 committed by GitHub
parent 4b767697af
commit 5831d80f51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 137 additions and 132 deletions

View file

@ -92,10 +92,11 @@ fn main() {
.update(|cx| {
let project_index = project_index.read(cx);
let query = "converting an anchor to a point";
project_index.search(query, 4, cx)
project_index.search(query.into(), 4, cx)
})
.unwrap()
.await;
.await
.unwrap();
for search_result in results {
let path = search_result.path.clone();