From 68571f6d12e11451ca28553136fface98e1b2e73 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:03:13 +0200 Subject: [PATCH] :facepalm: Fixed test_search test. Co-authored-by: Smit Barmase --- crates/project/src/project.rs | 46 ---------------------------- crates/project/src/project_search.rs | 5 ++- 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 9ad0bd411b119f4ba24dd9517feb62c633feb7f9..344f09a5210868a4aab1bdb0d662dd4e6b518958 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -4016,7 +4016,6 @@ impl Project { fs: self.fs.clone(), buffer_store: self.buffer_store.clone(), snapshots, - open_buffers: Default::default(), }; searcher.into_results(query, cx) } @@ -4024,51 +4023,6 @@ impl Project { self.search_impl(query, cx).results(cx) } - fn find_search_candidates_remote( - &mut self, - query: &SearchQuery, - limit: usize, - cx: &mut Context, - ) -> Receiver> { - let (tx, rx) = smol::channel::unbounded(); - - let (client, remote_id): (AnyProtoClient, _) = if let Some(ssh_client) = &self.remote_client - { - (ssh_client.read(cx).proto_client(), 0) - } else if let Some(remote_id) = self.remote_id() { - (self.collab_client.clone().into(), remote_id) - } else { - return rx; - }; - - let request = client.request(proto::FindSearchCandidates { - project_id: remote_id, - query: Some(query.to_proto()), - limit: limit as _, - }); - let guard = self.retain_remotely_created_models(cx); - - cx.spawn(async move |project, cx| { - let response = request.await?; - for buffer_id in response.buffer_ids { - let buffer_id = BufferId::new(buffer_id)?; - let buffer = project - .update(cx, |project, cx| { - project.buffer_store.update(cx, |buffer_store, cx| { - buffer_store.wait_for_remote_buffer(buffer_id, cx) - }) - })? - .await?; - let _ = tx.send(buffer).await; - } - - drop(guard); - anyhow::Ok(()) - }) - .detach_and_log_err(cx); - rx - } - pub fn request_lsp( &mut self, buffer_handle: Entity, diff --git a/crates/project/src/project_search.rs b/crates/project/src/project_search.rs index dc1161c9d39bd6061dd92f1f7eff2d87d54e7277..6a6ec8bd693d100c97012fe7927395835da469ff 100644 --- a/crates/project/src/project_search.rs +++ b/crates/project/src/project_search.rs @@ -29,7 +29,6 @@ pub(crate) struct Search { pub(crate) fs: Arc, pub(crate) buffer_store: Entity, pub(crate) snapshots: Vec<(Snapshot, WorktreeSettings)>, - pub(crate) open_buffers: HashSet, } const MAX_SEARCH_RESULT_FILES: usize = 5_000; @@ -98,7 +97,7 @@ impl Search { for _ in 0..executor.num_cpus() { let worker = Worker { query: &query, - open_buffers: &self.open_buffers, + open_buffers: &open_buffers, matched_buffer_count: &matched_buffer_count, matches_count: &matches_count, fs: &*self.fs, @@ -286,7 +285,7 @@ impl Worker<'_> { let Some(matches) = find_all_matches else { self.publish_matches = bounded(1).0; continue; - }; + }; let result = handler.handle_find_all_matches(matches).await; if let Some(_should_bail) = result { self.publish_matches = bounded(1).0;