Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix not sending `file_chunks` parameter to Sweep in evals (#46999)
Ben Kunkled1e4ef09eece
diff --git a/crates/edit_prediction/src/edit_prediction.rs b/crates/edit_prediction/src/edit_prediction.rsindex 406fd51bac5..5813cd40e9b 100644--- a/crates/edit_prediction/src/edit_prediction.rs+++ b/crates/edit_prediction/src/edit_prediction.rs@@ -2097,6 +2097,17 @@ impl EditPredictionStore {});}+ #[cfg(feature = "cli-support")]+ pub fn set_recent_paths_for_project(+ &mut self,+ project: &Entity<Project>,+ paths: impl IntoIterator<Item = project::ProjectPath>,+ cx: &mut Context<Self>,+ ) {+ let project_state = self.get_or_init_project(project, cx);+ project_state.recent_paths = paths.into_iter().collect();+ }+fn is_file_open_source(&self,project: &Entity<Project>,diff --git a/crates/edit_prediction/src/udiff.rs b/crates/edit_prediction/src/udiff.rsindex 2582c67615a..a9cb4fea771 100644--- a/crates/edit_prediction/src/udiff.rs+++ b/crates/edit_prediction/src/udiff.rs@@ -23,6 +23,10 @@ impl OpenedBuffers {pub fn get(&self, path: &str) -> Option<&Entity<Buffer>> {self.0.get(path)}++ pub fn buffers(&self) -> impl Iterator<Item = &Entity<Buffer>> {+ self.0.values()+ }}#[must_use]diff --git a/crates/edit_prediction_cli/src/load_project.rs b/crates/edit_prediction_cli/src/load_project.rsindex 7afbb871ff3..7dfaad47e1e 100644--- a/crates/edit_prediction_cli/src/load_project.rs+++ b/crates/edit_prediction_cli/src/load_project.rs@@ -12,8 +12,7 @@ use edit_prediction::{use futures::AsyncWriteExt as _;use gpui::{AsyncApp, Entity};use language::{Anchor, Buffer, LanguageNotFound, ToOffset, ToPoint};-use project::Project;-use project::buffer_store::BufferStoreEvent;+use project::{Project, ProjectPath, buffer_store::BufferStoreEvent};use std::{fs, path::PathBuf, sync::Arc};pub async fn run_load_project(@@ -32,6 +31,25 @@ pub async fn run_load_project(progress.set_substatus("applying edit history");let open_buffers = apply_edit_history(example, &project, &mut cx).await?;+ let ep_store = cx+ .update(|cx| EditPredictionStore::try_global(cx))+ .context("EditPredictionStore not initialized")?;++ let recent_paths: Vec<ProjectPath> = open_buffers+ .buffers()+ .filter_map(|buffer| {+ buffer.read_with(&cx, |buffer, cx| {+ buffer+ .file()+ .map(|file| ProjectPath::from_file(file.as_ref(), cx))+ })+ })+ .collect();++ ep_store.update(&mut cx, |store, cx| {+ store.set_recent_paths_for_project(&project, recent_paths, cx);+ });+progress.set_substatus("resolving cursor");let (buffer, cursor_position) =cursor_position(example, &project, &open_buffers, &mut cx).await?;@@ -39,10 +57,6 @@ pub async fn run_load_project(.read_with(&cx, |buffer, _| buffer.parsing_idle()).await;- let ep_store = cx- .update(|cx| EditPredictionStore::try_global(cx))- .context("EditPredictionStore not initialized")?;-let edit_history = ep_store.update(&mut cx, |store, cx| {store.edit_history_for_project(&project, cx)