Always store an rpc client on local worktrees
Even before sharing, we now want to advertise that the user is working on a certain worktree, to make that visible to all of the worktree's collaborators.
This commit is contained in:
@@ -546,10 +546,11 @@ impl Workspace {
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Task<Result<ModelHandle<Worktree>>> {
|
||||
let languages = self.languages.clone();
|
||||
let rpc = self.rpc.clone();
|
||||
let fs = self.fs.clone();
|
||||
let path = Arc::from(path);
|
||||
cx.spawn(|this, mut cx| async move {
|
||||
let worktree = Worktree::open_local(path, languages, fs, &mut cx).await?;
|
||||
let worktree = Worktree::open_local(rpc, path, fs, languages, &mut cx).await?;
|
||||
this.update(&mut cx, |this, cx| {
|
||||
cx.observe(&worktree, |_, _, cx| cx.notify()).detach();
|
||||
this.worktrees.insert(worktree.clone());
|
||||
@@ -826,7 +827,7 @@ impl Workspace {
|
||||
let worktree = this.worktrees.iter().next()?;
|
||||
worktree.update(cx, |worktree, cx| {
|
||||
let worktree = worktree.as_local_mut()?;
|
||||
Some(worktree.share(rpc, cx))
|
||||
Some(worktree.share(cx))
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user