Community
Participate
Working Groups
3.2 M3 test pass Most refactorings (except local variable rename and similar) force a save before they execute, and everything is saved after executing them. This is expected as I have a dialog and the 'save resources' query when triggering the refactoring. Now, when the refactoring has executed, and I choose undo, there are two possible paths: A) the changes were local to one CU and it is the active editor: - there is no dialog - the changes are undone - the CU is saved B) the changes span multiple CUs - a dialog warns me about the nature of the undo I am about to perform - choosing 'Ok' undoes all refactoring related changes and saves the CUs Since B) shows an informational dialog, I understand that I am about to undo a larger change which will modify more than just the CU and I understand that the editor is saved afterwards. In case A), however, I do not understand why the editor is saved after the undo. I can even execute Undo/Redo alternatingly, which will change the CU in front of me, withouth the editor becoming dirty, which is counterintuitive to what I am used to from using undo inside editors. IMO it would me more intuitive to leave the editor dirty after the undo in case A).
As discussed with Tom the problem is that refactoring doesn't know anything about who is triggering the undo. For example if the undo of the rename refactoring is triggered from the package explorer I think the file should be saved. To achieve the requested behaviour we need some info from the editor to know which files don't need saving. WE might be able to piggy back this information using the IAdaptable info in IUndoableOperation#undo/redo. Tom, Dani this information has to be provided by the editor undo/redo action. Any comments here ?
(In reply to comment #1) > As discussed with Tom the problem is that refactoring doesn't know anything > about who is triggering the undo. For example if the undo of the rename > refactoring is triggered from the package explorer I think the file should be > saved. I agree - the package explorer has a different undo model (no dirty state, but a workspace-global view).
When trying that I'm not so surprised that the file is saved. Also other undos return to a saved state. Ok to close?
No! :-) I still feel the same way - undo in the editor without a dialog must not touch the saved state.
>Also other undos return to a saved state. Yes, but only from the dirty state and not from a saved state.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.