Scope provider/content assist mismatch [message #759779] |
Wed, 30 November 2011 01:01 |
Mirko Raner Messages: 125 Registered: July 2009 Location: New York City, NY |
Senior Member |
|
|
Hi all,
we're having some problems in a project that consists of multiple interoperating Xtext languages which each have their own custom scope providers. Unfortunately, providing some concrete source code is not feasible, but I'd like to ask a general question:
We are seeing the behavior that a certain model element appears as part of the content assist (i.e., it is apparently in scope) but once the user selects that element and inserts it into the source it immediately gets underlined in red and we see an error message saying that it could not resolve the reference to that element.
So, on the one hand the scope seems fine for the content assist, but once inserted into the source the element appears to be no longer in scope. We were wondering whether we have some ambiguities in our grammars that would change the way the source code is parsed after an element is inserted, but so far we were unable to confirm that suspicion.
So, generally speaking, what are the things that one should look into when encountering the described behavior?
Thanks a lot!
|
|
|
|
Re: Scope provider/content assist mismatch [message #759812 is a reply to message #759779] |
Wed, 30 November 2011 07:46 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Mirko,
it sounds like you enabled backtracking in your grammar where something
like this could happen (simplified):
Rule: RuleA | RuleB;
RuleA: name = ID crossRefA=[Something];
RuleB: name = ID crossRefB=[SomethingElse|QualifiedName];
Input model (| indicates the cursor position):
myId |
If you invoke CA at that position, you'll get all Somethings and
SomethingElses proposed. If however, the selected SomethingElse has only
a simple name, the parser will choose the first path as soon as you
inserted the name because RuleB will never be chosen due to backtracking.
Is that the case for your language?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 30.11.11 02:01, schrieb Mirko Raner:
> Hi all,
>
> we're having some problems in a project that consists of multiple
> interoperating Xtext languages which each have their own custom scope
> providers. Unfortunately, providing some concrete source code is not
> feasible, but I'd like to ask a general question:
> We are seeing the behavior that a certain model element appears as part
> of the content assist (i.e., it is apparently in scope) but once the
> user selects that element and inserts it into the source it immediately
> gets underlined in red and we see an error message saying that it could
> not resolve the reference to that element.
> So, on the one hand the scope seems fine for the content assist, but
> once inserted into the source the element appears to be no longer in
> scope. We were wondering whether we have some ambiguities in our
> grammars that would change the way the source code is parsed after an
> element is inserted, but so far we were unable to confirm that suspicion.
> So, generally speaking, what are the things that one should look into
> when encountering the described behavior?
>
> Thanks a lot!
>
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds