-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workspace: fix untitled file-saving #12577
workspace: fix untitled file-saving #12577
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave the review offline but for transparency I'll include an update.
We should align the behavior when closing the application and there are unsaved changes with VS Code by:
- prompting once for all unsaved changes (resources + untitled resources)
- selecting
save all
from the dialog should save all resources, and should prompt to select a location for the untitled resources (similarly tosave as...
) - we should attempt to save the untitled resources in the current workspace by default (might be tricky since we do not know about workspaces in
@theia/core
)
This should fix the main user-experience issues present in the pull-request where we prompt for each untitled file whether we want to save or not. It also fixes the issue where if we dont save the untitled files we still show them later in the main "save all" dialog.
@vladarama Is this ready for a re-review? |
4a95793
to
1ca2420
Compare
This commit fixes the untitled file-saving issue by making sure that the untitled files are saved correctly before closing the workspace / closing the application. Signed-off-by: Vlad Arama <[email protected]>
1ca2420
to
14fea31
Compare
@JonasHelming |
This commit includes a refactoring of the `onWillStop()` method to prevent the workspace from closing when we decide to cancel the file saving dialog. Signed-off-by: Vlad Arama <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I confirmed that the behavior for dirty untitled documents is fixed with the changes.
What it does
This PR fixes #12557 by fixing the untitled file saving behavior when closing the
Workspace
. The user should now be prompted to select a location to save the untitled file before closing theWorkspace
. The file should be saved at the chosen location, and theWorkspace
should reload successfully, preserving the newly created file.How to test
File
->AutoSave
File
->New File
orAlt+N
File
->Close Workspace
Save
and choose a location to save the fileWorkspace
and the newly created file should be saved successfullyReview checklist
Reminder for reviewers