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
Save all open editors before running Save As
#939
Conversation
@AlbyIanna Yeah, sadly the internal Theia 1.22 code for Promise.all(widgets, widget => {
if (Saveable.is(widget)) {
Saveable.save(widget); // Note the missing "await" here
}
}); Which is why we need to wait. But you're right, overriding the Note that the saving functionality has been moved into its own service which correctly uses Perhaps we should try to update to 1.24 soon? |
If I create a new Sketch and try to close it, it triggers a "Save sketch folder as..." (should be "Save Sketch as...") but no matter how many times I click on "Save" it won't happen and the dialog will keep popping up. |
@ubidefeo oh right that happens to me too with new sketches.
I get the same buggy behaviour @ubidefeo is describing. |
@AlbyIanna @ubidefeo the weird behavior when closing app is related to this code, and will likely be addressed by #893. It's independent of this change. |
UPDATE: fixed by https://github.com/arduino/arduino-ide/compare/51af711f7b70f6310787360a25294193ddefb280..2543d1b0c81f437e3f8c6dbc60f064bcdb425236
>This saves any unsaved changes to the current sketch as well. Is this alright with the usability concept? Or should the new changes exclusively be saved to the new sketch?
They must be saved exclusively to the new sketch, just as "Save as" works in every other application ever made.
We are going to merge this PR only when #893 will be approved because we want to solve all the major saving issues together. |
@per1234 @AlbyIanna Thanks for the feedback, I've changed the code to only save the changes to the new sketch. Mind retesting? |
UPDATE: Fixed by https://github.com/arduino/arduino-ide/compare/2543d1b0c81f437e3f8c6dbc60f064bcdb425236..6299e87015c745f7e1588e4b438df893d2c300de
### Describe the problem
When using the build from this PR, performing a "Save As..." operation when the sketch has unsaved changes produces an unexpected dialog about quitting:
To reproduce
- Select File > Preferences from the Arduino IDE menus.
- Uncheck the box next to "☐ Auto save"
- Click the OK button.
- Make some change to the sketch (I will refer to this as "Sketch A" from here on).
❗ Do not save. - Select File > Save As... from the Arduino IDE menus.
- Click the Save button.
(I will refer to this as "Sketch B" from here on)
Are you sure you want to quit?
Any unsaved changes will not be saved.
Expected behavior
No quit confirmation dialog on "Save As...".
The IDE must be smart enough to understand that, even though it is true that the unsaved changes are not saved to "Sketch A", they are saved to "Sketch B" and it is standard and expected by the user that changes would not be saved to "Sketch A".
The IDE must be smart enough to understand that the closure of "Sketch A" when saving as "Sketch B" is different from a normal close of a window. The replacement of "Sketch A" by "Sketch B" in the application after a "Save As..." operation is simply standard and expected behavior of any application and the user should not be consulted about it or exposed to whatever specific mechanism the IDE is using to accomplish that replacement.
Arduino IDE version
2.0.0-rc6-snapshot-7ef629a
(the tester build for 2543d1b)
Operating system
Windows 10
@per1234 Sorry, small oversight, should be fixed now. That was the underlying Theia |
Motivation
Closes #896
Change description
Invokes the
saveAll
operation of theApplicationShell
before saving the sketch to a new location.Other information
This saves any unsaved changes to the current sketch as well. Is this alright with the usability concept? Or should the new changes exclusively be saved to the new sketch? (this would be a bit more involved)
Reviewer checklist