Don't show conflict indicator on remote buffer after a reload

This commit is contained in:
Antonio Scandurra 2022-01-24 10:17:36 +01:00
parent 4372fe1ed0
commit f859d444ff
6 changed files with 201 additions and 17 deletions

View file

@ -1520,6 +1520,28 @@ impl language::LocalFile for File {
cx.background()
.spawn(async move { fs.load(&abs_path).await })
}
fn buffer_reloaded(
&self,
buffer_id: u64,
version: &clock::Global,
mtime: SystemTime,
cx: &mut MutableAppContext,
) {
let worktree = self.worktree.read(cx).as_local().unwrap();
if let Some(project_id) = worktree.share.as_ref().map(|share| share.project_id) {
let rpc = worktree.client.clone();
let message = proto::BufferReloaded {
project_id,
buffer_id,
version: version.into(),
mtime: Some(mtime.into()),
};
cx.background()
.spawn(async move { rpc.send(message).await })
.detach_and_log_err(cx);
}
}
}
impl File {