Mainline GPUI2 UI work (#3079)

This PR mainlines the current state of new GPUI2-based UI from the
`gpui2-ui` branch.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Nate <nate@zed.dev>
This commit is contained in:
Marshall Bowers 2023-10-02 18:20:47 -04:00 committed by GitHub
parent 08361eb84e
commit 9e1f7c4c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1047 additions and 399 deletions

View file

@ -4957,8 +4957,16 @@ impl Project {
if abs_path.ends_with("/") {
fs.create_dir(&abs_path).await?;
} else {
fs.create_file(&abs_path, op.options.map(Into::into).unwrap_or_default())
.await?;
fs.create_file(
&abs_path,
op.options
.map(|options| fs::CreateOptions {
overwrite: options.overwrite.unwrap_or(false),
ignore_if_exists: options.ignore_if_exists.unwrap_or(false),
})
.unwrap_or_default(),
)
.await?;
}
}
@ -4974,7 +4982,12 @@ impl Project {
fs.rename(
&source_abs_path,
&target_abs_path,
op.options.map(Into::into).unwrap_or_default(),
op.options
.map(|options| fs::RenameOptions {
overwrite: options.overwrite.unwrap_or(false),
ignore_if_exists: options.ignore_if_exists.unwrap_or(false),
})
.unwrap_or_default(),
)
.await?;
}
@ -4984,7 +4997,13 @@ impl Project {
.uri
.to_file_path()
.map_err(|_| anyhow!("can't convert URI to path"))?;
let options = op.options.map(Into::into).unwrap_or_default();
let options = op
.options
.map(|options| fs::RemoveOptions {
recursive: options.recursive.unwrap_or(false),
ignore_if_not_exists: options.ignore_if_not_exists.unwrap_or(false),
})
.unwrap_or_default();
if abs_path.ends_with("/") {
fs.remove_dir(&abs_path, options).await?;
} else {