Community
Participate
Working Groups
Build Identifier: I20110613-1736 When an Xtext editor becomes 'clean' the state of DirtyStateEditorSupport's dirtyResource is not updated to reflect the current state of the underlying resource. This may lead to curious behavior in 'undo/redo' scenarios (described below). Reproducible: Always Steps to Reproduce: 1. Import the attached projects (abridged 'org.xtext.example.domainmodel') into the workspace 2. Run the runtime workbench and make a Java project with files 'A.dmodel' and 'B.dmodel' with the following contents: A.dmodel: entity A {} B.dmodel: entity B extends A {} 3. Open 'A.dmodel' and 'B.dmodel'. Select the editor for 'A.dmodel' and modify its contents to be 'entity C {}'. Notice the error tick on the 'B.dmodel' editor 4. Undo the change and notice the error tick on the 'B.dmodel' editor is gone away 5. Redo the change and notice that in this case there is no error tick on the 'B.dmodel' editor (i.e., it has not been validated) This bug seems to be caused by the call sequence of #markEditorClean and #modelChanged in DirtyStateEditorSupport. Namely, when Undo is done, #markEditorClean is called first and sets 'isDirty' flag to false. Then #modelChanged is called (asynchronously) and since 'isDiry' is false, it does not try to copy the underlying resource state into 'dirtyResource'. Then, when Redo is done, #modelChange decides there is no 'stuctural' change and hence it does not announce 'dirty state change'.
Created attachment 201070 [details] Sample language projects
Please double check with Xtext 2.0.1. I think I fixed this one.
Never mind, I can reproduce this one.
Pushed to master.
Closing all bugs that were set to RESOLVED before Neon.0