ParserBasedContentAssistContextFactory.StatefulFactory mixing instances of the same grammar [message #1005785] |
Mon, 28 January 2013 17:41 |
Romain Bioteau Messages: 65 Registered: August 2009 Location: Grenoble |
Member |
|
|
Hello,
I have an issue with the content assist failing to lookup for cross references when I use an EmbeddedEditor. It works well in a classic editor part.
After some hours of debugging it seems to be an issue with the ParserBasedContentAssistContextFactory.StatefulFactory.
The parser is dealing with EObject of my grammar but from two different instances of my grammar model which lead to parsing issue and failed to create a proper ContentAssistContext ( with a non null current model).
To be more precise when the doCreateContexts(
INode lastCompleteNode, INode currentNode,
String prefix, EObject previousModel,
Collection<FollowElement> followElements) is called :
the followElements are contained in a Grammar with instance id @1919ef, but the currentNode.getGrammarElement() is contained in a Grammar with another instance id. Thus, during the parsing, when doing all the switches with eobject comparaisons it fails.
This is happening with the content assist of the embedded editor only !
As I'm not friendly at all with injection stuff, I'm not able to understand how I can end up with this strange behavior.
Does someone can help me with this ?
Best regards
Romain
R&D Engineer at BonitaSoft
|
|
|
Re: ParserBasedContentAssistContextFactory.StatefulFactory mixing instances of the same grammar [message #1005874 is a reply to message #1005785] |
Tue, 29 January 2013 07:24 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Romain,
please make sure that you do not (and never) use the STandalone setup of
your language within Eclipse.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 28.01.13 18:41, schrieb Romain Bioteau:
> Hello,
> I have an issue with the content assist failing to lookup for cross
> references when I use an EmbeddedEditor. It works well in a classic
> editor part.
>
> After some hours of debugging it seems to be an issue with the
> ParserBasedContentAssistContextFactory.StatefulFactory.
> The parser is dealing with EObject of my grammar but from two different
> instances of my grammar model which lead to parsing issue and failed to
> create a proper ContentAssistContext ( with a non null current model).
>
> To be more precise when the doCreateContexts(
> INode lastCompleteNode, INode currentNode,
> String prefix, EObject previousModel,
> Collection<FollowElement> followElements) is called :
>
> the followElements are contained in a Grammar with instance id @1919ef,
> but the currentNode.getGrammarElement() is contained in a Grammar with
> another instance id. Thus, during the parsing, when doing all the
> switches with eobject comparaisons it fails.
>
> This is happening with the content assist of the embedded editor only !
>
> As I'm not friendly at all with injection stuff, I'm not able to
> understand how I can end up with this strange behavior.
> Does someone can help me with this ?
>
> Best regards
> Romain
>
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01867 seconds