Skip to content

Commit b74ed69

Browse files
ConradIrwinmikayla-maki
authored andcommitted
Rebuild buffer store to be aware of remote/local distinction (zed-industries#18303)
Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev>
1 parent bee6cbb commit b74ed69

File tree

6 files changed

+1192
-891
lines changed

6 files changed

+1192
-891
lines changed

crates/collab/src/tests/remote_editing_collaboration_tests.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use call::ActiveCall;
33
use fs::{FakeFs, Fs as _};
44
use gpui::{Context as _, TestAppContext};
55
use language::language_settings::all_language_settings;
6+
use project::ProjectPath;
67
use remote::SshSession;
78
use remote_server::HeadlessProject;
89
use serde_json::json;
@@ -108,14 +109,36 @@ async fn test_sharing_an_ssh_remote_project(
108109
});
109110

110111
project_b
111-
.update(cx_b, |project, cx| project.save_buffer(buffer_b, cx))
112+
.update(cx_b, |project, cx| {
113+
project.save_buffer_as(
114+
buffer_b.clone(),
115+
ProjectPath {
116+
worktree_id: worktree_id.to_owned(),
117+
path: Arc::from(Path::new("src/renamed.rs")),
118+
},
119+
cx,
120+
)
121+
})
112122
.await
113123
.unwrap();
114124
assert_eq!(
115125
remote_fs
116-
.load("/code/project1/src/lib.rs".as_ref())
126+
.load("/code/project1/src/renamed.rs".as_ref())
117127
.await
118128
.unwrap(),
119129
"fn one() -> usize { 100 }"
120130
);
131+
cx_b.run_until_parked();
132+
cx_b.update(|cx| {
133+
assert_eq!(
134+
buffer_b
135+
.read(cx)
136+
.file()
137+
.unwrap()
138+
.path()
139+
.to_string_lossy()
140+
.to_string(),
141+
"src/renamed.rs".to_string()
142+
);
143+
});
121144
}

0 commit comments

Comments
 (0)