assistant edit tool: Use buffer search and replace in background (#26679)
Instead of getting the whole text from the buffer, replacing with `String::replace`, and getting a whole diff, we'll now use `SearchQuery` to get a range, diff only that range, and apply it (all in the background). When we match zero strings, we'll record a "bad search", keep going and report it to the model at the end. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
@@ -526,8 +526,8 @@ impl DerefMut for ChunkRendererContext<'_, '_> {
|
||||
/// A set of edits to a given version of a buffer, computed asynchronously.
|
||||
#[derive(Debug)]
|
||||
pub struct Diff {
|
||||
pub(crate) base_version: clock::Global,
|
||||
line_ending: LineEnding,
|
||||
pub base_version: clock::Global,
|
||||
pub line_ending: LineEnding,
|
||||
pub edits: Vec<(Range<usize>, Arc<str>)>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user