Rebuild buffer store to be aware of remote/local distinction (#18303)

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin 2024-09-24 15:52:30 -06:00 committed by GitHub
parent da1ef13442
commit c4e0f5e0ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1127 additions and 826 deletions

View file

@ -3,6 +3,7 @@ use call::ActiveCall;
use fs::{FakeFs, Fs as _};
use gpui::{Context as _, TestAppContext};
use language::language_settings::all_language_settings;
use project::ProjectPath;
use remote::SshSession;
use remote_server::HeadlessProject;
use serde_json::json;
@ -108,14 +109,36 @@ async fn test_sharing_an_ssh_remote_project(
});
project_b
.update(cx_b, |project, cx| project.save_buffer(buffer_b, cx))
.update(cx_b, |project, cx| {
project.save_buffer_as(
buffer_b.clone(),
ProjectPath {
worktree_id: worktree_id.to_owned(),
path: Arc::from(Path::new("src/renamed.rs")),
},
cx,
)
})
.await
.unwrap();
assert_eq!(
remote_fs
.load("/code/project1/src/lib.rs".as_ref())
.load("/code/project1/src/renamed.rs".as_ref())
.await
.unwrap(),
"fn one() -> usize { 100 }"
);
cx_b.run_until_parked();
cx_b.update(|cx| {
assert_eq!(
buffer_b
.read(cx)
.file()
.unwrap()
.path()
.to_string_lossy()
.to_string(),
"src/renamed.rs".to_string()
);
});
}