Restore project diff test (#21606)
Restores a basic project diff test Release Notes: - N/A --------- Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
787c75cbda
commit
1efd165ead
2 changed files with 141 additions and 112 deletions
|
@ -49,6 +49,7 @@ struct SharedBuffer {
|
|||
unstaged_changes: Option<Model<BufferChangeSet>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BufferChangeSet {
|
||||
pub buffer_id: BufferId,
|
||||
pub base_text: Option<Model<Buffer>>,
|
||||
|
@ -1045,6 +1046,12 @@ impl BufferStore {
|
|||
.spawn(async move { task.await.map_err(|e| anyhow!("{e}")) })
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn set_change_set(&mut self, buffer_id: BufferId, change_set: Model<BufferChangeSet>) {
|
||||
self.loading_change_sets
|
||||
.insert(buffer_id, Task::ready(Ok(change_set)).shared());
|
||||
}
|
||||
|
||||
pub async fn open_unstaged_changes_internal(
|
||||
this: WeakModel<Self>,
|
||||
text: Result<Option<String>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue