Start tracking edits performed by the agent (#27064)

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
Antonio Scandurra 2025-03-19 14:07:25 +01:00 committed by GitHub
parent 23686aa394
commit ac5dafc6b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1423 additions and 344 deletions

View file

@ -1,5 +1,6 @@
use std::fmt::Write as _;
use std::io::Write;
use std::ops::Range;
use std::sync::Arc;
use anyhow::{Context as _, Result};
@ -975,6 +976,10 @@ impl Thread {
})
}
pub fn project(&self) -> &Entity<Project> {
&self.project
}
/// Create a snapshot of the current project state including git information and unsaved buffers.
fn project_snapshot(
project: Entity<Project>,
@ -1123,6 +1128,18 @@ impl Thread {
Ok(String::from_utf8_lossy(&markdown).to_string())
}
pub fn review_edits_in_range(
&mut self,
buffer: Entity<language::Buffer>,
buffer_range: Range<language::Anchor>,
accept: bool,
cx: &mut Context<Self>,
) -> Task<Result<()>> {
self.action_log.update(cx, |action_log, cx| {
action_log.review_edits_in_range(buffer, buffer_range, accept, cx)
})
}
pub fn action_log(&self) -> &Entity<ActionLog> {
&self.action_log
}