diff --git a/crates/edit_prediction/src/capture_example.rs b/crates/edit_prediction/src/capture_example.rs index 0171b711dd24384e1588c076d4b4f678723d7459..d64a9ea03d056e0b428507104a8d422d309c76db 100644 --- a/crates/edit_prediction/src/capture_example.rs +++ b/crates/edit_prediction/src/capture_example.rs @@ -15,7 +15,6 @@ pub fn capture_example( project: Entity, buffer: Entity, cursor_anchor: language::Anchor, - last_event_is_expected_patch: bool, cx: &mut App, ) -> Option>> { let ep_store = EditPredictionStore::try_global(cx)?; @@ -36,7 +35,7 @@ pub fn capture_example( .or_else(|| repository_snapshot.remote_upstream_url.clone())?; let revision = repository_snapshot.head_commit.as_ref()?.sha.to_string(); - let mut events = ep_store.update(cx, |store, cx| { + let events = ep_store.update(cx, |store, cx| { store.edit_history_for_project_with_pause_split_last_event(&project, cx) }); @@ -54,13 +53,6 @@ pub fn capture_example( .await; let mut edit_history = String::new(); - let mut expected_patch = String::new(); - if last_event_is_expected_patch { - if let Some(stored_event) = events.pop() { - zeta_prompt::write_event(&mut expected_patch, &stored_event.event); - } - } - for stored_event in &events { zeta_prompt::write_event(&mut edit_history, &stored_event.event); if !edit_history.ends_with('\n') { @@ -68,17 +60,15 @@ pub fn capture_example( } } - let name = generate_timestamp_name(); - Ok(ExampleSpec { - name, + name: generate_timestamp_name(), repository_url, revision, uncommitted_diff, cursor_path: cursor_path.as_std_path().into(), cursor_position: cursor_excerpt, edit_history, - expected_patch, + expected_patch: String::new(), }) })) } @@ -289,9 +279,7 @@ mod tests { cx.run_until_parked(); let mut example = cx - .update(|cx| { - capture_example(project.clone(), buffer.clone(), Anchor::MIN, false, cx).unwrap() - }) + .update(|cx| capture_example(project.clone(), buffer.clone(), Anchor::MIN, cx).unwrap()) .await .unwrap(); example.name = "test".to_string(); diff --git a/crates/edit_prediction_ui/src/edit_prediction_ui.rs b/crates/edit_prediction_ui/src/edit_prediction_ui.rs index 9dc7623f79cab61350a06740440bae5cb4e3f40f..6f29bbaf2c89df295768b3db5dcde94a3a643195 100644 --- a/crates/edit_prediction_ui/src/edit_prediction_ui.rs +++ b/crates/edit_prediction_ui/src/edit_prediction_ui.rs @@ -150,7 +150,7 @@ fn capture_example_as_markdown( .buffer() .read(cx) .text_anchor_for_position(editor.selections.newest_anchor().head(), cx)?; - let example = capture_example(project.clone(), buffer, cursor_anchor, true, cx)?; + let example = capture_example(project.clone(), buffer, cursor_anchor, cx)?; let examples_dir = AllLanguageSettings::get_global(cx) .edit_predictions