Infinite loop when refreshing the outline [message #1000847] |
Tue, 15 January 2013 14:38 |
Charles Bonneau Messages: 32 Registered: February 2010 Location: Belgium |
Member |
|
|
Hello,
I have a problem caused by a very dumb behavior, but it still needs to be addressed.
My grammar is based on a Ecore model that I can't modify:
Container returns widgets::Container:
{widgets::Container}
'Container' (id=EString)? '{'
(children+=AbstractComponent (children+=AbstractComponent)*)?
'}';
AbstractComponent returns widgets::AbstractComponent:
Container |
Text |
Label;
The "id" attribute of a "Container" is its identifier (in the ecore definition).
So when a user write (I know this is really dumb)
Container "ID"
{
Container "ID"
{
Container "ID"
{
}
}
}
The outline refresh job falls into an infinite loop and finally end up with a StackOverflowError.
I've investigated this error, and found that the problem come from this method :
org.eclipse.xtext.ui.editor.outline.impl.AbstractOutlineNode.readOnly(final IUnitOfWork<T, EObject> work)
To build an Outline node, it retrieves the EObject from the resource based on its URI, which is : <path of the model>#<Identifier of the Object>, which, in my use case, is always the ID of root element of the model.
I've tried to apply some validation before the refresh Job. But of course the faulty value were not yet committed to the resource and the validation passed.
I'm out of ideas here.
Could please give me some hints or ideas to help me solve this ?
Best regards,
Charles Bonneau
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03019 seconds