|Xtext editor does not reflect changes in linked resources [message #1407785]
||Wed, 13 August 2014 12:47
| Till F.
Registered: August 2012
The Xtext editor for my custom grammer does not reflect changes in linked resources, even though these changes are reflected correctly in other places (e.g. "Problems" view) immediately.
My grammer uses importURI to load additional resources (Ecore models). If I change something in such a resource, Xtext automatically updates all documents of my grammer in the workspace. When a custom validation adds a warning/error because of the resource change, this is correctly displayed in eclipse (e.g. red "x" on the file icon and corresponding entry in the "Problems" view).
But if the affected document is opened in the editor, corresponding locations are only marked as desired, if no user input has been made yet. If the document was changed (reparsed), changes on other resources still cause correct icons to appear/disappear in the project explorer, but the opened xtext editor does not reflect these changes. More precisely: If errors/warnings get fixed, they dissappear from the "Problems" view, but are still marked in the document. If new errors/warnings occur, they are added to the "Problems" view, but are not marked in the document. Instead, the corresponding lines, where errors/warnings should get marked, show the gray-shaded "x" that eclipse displays for a short period of time when a marker disappears. In this case, however, the "x" is shown forver.
If I close and re-open the document, it immediately shows correct markers.
I doubt that this is normal behavior, is it?
But what could go wrong here? I have a suspicion which is not more than a guess as I did not have a deep look into corresponding Xtext source code: an explanation could be that linked resources are cached when a document is (re)parsed due to user input in the editor. Afterwards, any changes on these resources are not correctly reflected as the cache is not updated / notified aubot the change. I did not implement such a caching mechanism myself, but I implemented my own scope provider by extending AbstractDeclarativeScopeProvider. Maybe It must be notified about resource changes somehow?
Any hints would be appreciated!
Powered by FUDForum
. Page generated in 0.01955 seconds