Community
Participate
Working Groups
If you have a dirty editor and revert the underlying file without closing or saving the editor, the save is not possible afterwards at all. Steps to reproduce: 1) Check out a file for a Xtext-Editor (could be xtext directly) 2) Open the file in the Xtext-Editor 3) Change something and save 4) Save something again and make the editor dirty 5) Revert the file and deny saving it before (with egit you are only asked to replace the file) 6) Try saving it fails now. Expected: Other editors ask to replace the file if it changed on the filesystem. If you deny, the input from editor overwrite the reverted file.
Debugging shows, that the AbstractTextEditor only asks to overwrite, if the file was changed outside eclipse. If you revert with eclipse, the workspace knows the new state and doesn't ask to overwrite (see handleExceptionOnSave isSynchronized). A Java-Editor asks after activating the editor again, if the content should be reloaded. If not, the file overwrites with the next save.
Created attachment 195639 [details] Patch XtextDocumentProvider.isSynchronized This patch adds an additional modification check, which works, if the file in the workspace is modified after the document read the Resource.
pushed to master
Closing all bugs that were set to RESOLVED before Neon.0