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:
parent
6767e98e00
commit
8ec0309645
2 changed files with 219 additions and 111 deletions
|
@ -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>)>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue