mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 15:10:34 +01:00
Improve edit prediction example capture (#45536)
This PR improves the `edit prediction: Capture Example` in several ways: * fixed bugs in how the uncommitted diff was calculated * added a `edit_predictions.examples_dir` setting that can be set in order to have the action automatically save examples into the given folder * moved the action into the `edit_predictions` crate, in preparation for collecting this data passively from end users, when they have opted in to data sharing, similar to what we did for Zeta 1 Release Notes: - N/A
This commit is contained in:
@@ -314,6 +314,12 @@ impl BufferDiffSnapshot {
|
||||
self.inner.hunks.is_empty()
|
||||
}
|
||||
|
||||
pub fn base_text_string(&self) -> Option<String> {
|
||||
self.inner
|
||||
.base_text_exists
|
||||
.then(|| self.inner.base_text.text())
|
||||
}
|
||||
|
||||
pub fn secondary_diff(&self) -> Option<&BufferDiffSnapshot> {
|
||||
self.secondary_diff.as_deref()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user