agent: Review edits in single-file editors (#29820)

Enables reviewing agent edits from single-file editors in addition to
the multibuffer experience we already had.


https://github.com/user-attachments/assets/a2c287f0-51d6-43a1-8537-821498b91983


This feature can be turned off by setting `assistant.single_file_review:
false`.

Release Notes:

- agent: Review edits in single-file editors
This commit is contained in:
Agus Zubiaga 2025-05-02 17:57:16 -03:00 committed by GitHub
parent 04772bf17d
commit 64316309aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1396 additions and 254 deletions

View file

@ -2636,6 +2636,11 @@ impl MultiBuffer {
self.snapshot.borrow().all_diff_hunks_expanded
}
pub fn set_all_diff_hunks_collapsed(&mut self, cx: &mut Context<Self>) {
self.snapshot.borrow_mut().all_diff_hunks_expanded = false;
self.expand_or_collapse_diff_hunks(vec![Anchor::min()..Anchor::max()], false, cx);
}
pub fn has_multiple_hunks(&self, cx: &App) -> bool {
self.read(cx)
.diff_hunks_in_range(Anchor::min()..Anchor::max())