@@ -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)
})?
})