Project: aptanastudio
Issue APSTUD-4410: Prompt user before deleting a file with Undo
Steps as listed here: File > New File will create a new file. This will not respond to "Undo" (see Eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901 where they fixed that) To replicate: Eclipse 3.7.1 (JDT): Navigator, but not Package Explorer or Project Explorer Titanium Studio (dev): App Explorer and Project Explorer Titanium Studio 1.0.9: App Explorer and Project Explorer # Open a file in the Editor. # Select a file in a view listed above, in a non-Java project. # Copy and paste the file in the view. The default name is fine. # Go to the editor. Type a key and leave it unsaved. # Re-focus the Project Explorer view. Press "Undo". The file copy will go away. Now... # Open up the .project file # add org.eclipse.jdt.core.javanature to the project natures # Close and reopen the project as above # Retry the above steps. It won't work. However, you can get the contents back again: # Go into "Project Explorer" # Right-click on the root of the project in question and select "Restore From Local History..." # Select the particular resource, and if you like, select a version. Finish out of the dialog. I thought this was an Eclipse bug, but since I can't replicate it in Project Explorer with a Java project, but I _can_ replicate it with an Aptana-natured Project (or actually a project with no natures too), I'm a bit confused. As evidenced by this thread (http://developer.appcelerator.com/question/121789/titanium-studio-deleting-my-files#answer-231188), users run into this issue all the time. We should prompt the user before confirmation if we are in a state where there is a file deletion happening as a result of an undo event. Perhaps it's possible to listen for resource change events of this type, and ask the user in advance of the event happening. Note that they originally fixed the issue by removing file creation events from the undo history.
Story points: 13