project: Remove unused BufferOpened event (#49775)

This commit is contained in:
Xiaobo Liu authored and GitHub committed 2026-02-21 10:10:51 +00:00
1 parent b49698b3e5
commit 5205e54d7e
2 files changed
+1 -17

No files matched your search

+1 -16
View File
@@ -86,11 +86,6 @@ enum OpenBuffer {
pub enum BufferStoreEvent {
BufferAdded(Entity<Buffer>),
// TODO(jk): this event seems unused
BufferOpened {
buffer: Entity<Buffer>,
project_path: ProjectPath,
},
SharedBufferClosed(proto::PeerId, BufferId),
BufferDropped(BufferId),
BufferChangedFilePath {
@@ -853,11 +848,6 @@ impl BufferStore {
cx: &mut Context<Self>,
) -> Task<Result<Entity<Buffer>>> {
if let Some(buffer) = self.get_by_path(&project_path) {
cx.emit(BufferStoreEvent::BufferOpened {
buffer: buffer.clone(),
project_path,
});
return Task::ready(Ok(buffer));
}
@@ -882,16 +872,11 @@ impl BufferStore {
// todo(lw): hot foreground spawn
cx.spawn(async move |this, cx| {
let load_result = load_buffer.await;
this.update(cx, |this, cx| {
this.update(cx, |this, _cx| {
// Record the fact that the buffer is no longer loading.
this.loading_buffers.remove(&project_path);
let buffer = load_result.map_err(Arc::new)?;
cx.emit(BufferStoreEvent::BufferOpened {
buffer: buffer.clone(),
project_path,
});
Ok(buffer)
})?
})
-1
View File
@@ -1615,7 +1615,6 @@ impl GitStore {
.detach();
}
}
_ => {}
}
}