Skip to content

simpleFileDialog: ask user if we should create directory if it doesn't exist when saving#152536

Merged
alexr00 merged 2 commits into
microsoft:mainfrom
zhuowei:simple-file-dialog-create-directory
Aug 5, 2022
Merged

simpleFileDialog: ask user if we should create directory if it doesn't exist when saving#152536
alexr00 merged 2 commits into
microsoft:mainfrom
zhuowei:simple-file-dialog-create-directory

Conversation

@zhuowei

@zhuowei zhuowei commented Jun 18, 2022

Copy link
Copy Markdown
Contributor

Screen Shot 2022-06-17 at 9 11 39 PM

When saving a file using the SimpleFileDialog (for example, when editing a file over SSH), if the directory doesn't exist, the user currently has to cancel saving, create the directory, then try saving again.

This adds a prompt to allow the user to create any missing directories from the save dialog directly.

Tested with the TestResolver in Code - OSS.

I wasn't able to get the Remote - SSH extension working in Code - OSS, but it should work there, since FileService.writeFile calls mkdirp to create missing folders, so this should work with all remote providers.

This PR fixes #71425.

…t exist when saving

When saving a file using the SimpleFileDialog (for example, when editing a file over SSH), if the directory doesn't exist, the user currently has to cancel saving, create the directory, then try saving again.

This adds a prompt to allow the user to create any missing directories from the save dialog directly.

Tested with the TestResolver in Code - OSS.

I wasn't able to get the Remote - SSH extension working in Code - OSS, but it should work there, since FileService.writeFile calls mkdirp to create missing folders, so this should work with all remote providers.

Fixes microsoft#71425.
@laurentlb

Copy link
Copy Markdown
Contributor

@alexr00 any concern with this PR?

@alexr00 alexr00 added this to the August 2022 milestone Aug 5, 2022

@alexr00 alexr00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurentlb no concerns, I just didn't have a chance to review.
@zhuowei thank you for the PR! Looks good, and I agree that it should work with other remotes.

@alexr00 alexr00 merged commit 0fa4923 into microsoft:main Aug 5, 2022
joyceerhl pushed a commit that referenced this pull request Aug 10, 2022
…t exist when saving (#152536)

When saving a file using the SimpleFileDialog (for example, when editing a file over SSH), if the directory doesn't exist, the user currently has to cancel saving, create the directory, then try saving again.

This adds a prompt to allow the user to create any missing directories from the save dialog directly.

Tested with the TestResolver in Code - OSS.

I wasn't able to get the Remote - SSH extension working in Code - OSS, but it should work there, since FileService.writeFile calls mkdirp to create missing folders, so this should work with all remote providers.

Fixes #71425.

Co-authored-by: Alex Ross <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create new folder in simplified file dialog

4 participants