Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » dot notation and scoping
dot notation and scoping [message #1073391] Wed, 24 July 2013 13:07 Go to next message
Thomas Pramsohler is currently offline Thomas Pramsohler
Messages: 2
Registered: March 2013
Junior Member
I have a dot-notation in my grammar with the following Rule:

ModelElementReference hidden() :
element=[ModelElement](Array ?='[' arrayIndex=INT ']')? (hasNestedElement ?='.' nestedElement=ModelElementReference)?;

The rule works fine and it produces the right grammar. for example connectMethod.inputParameterStruct.structValue

Now i want to use the scoping api in order to have the right context assist. In my example only parameters of the connectMethod should be visible. But the scope which is called if i write "connectMethod." and press Strg+SPACE is:

scope_ModelElementReference_element with the context ModelElementReference of the connectMethod-element. In my opinion the context should be the one of the nested ModelElementReference which has a ModelElementReference as eContainer.

After writing the correct text, the scoping gets applied properly, but the context assist does not work.

Maybe someone can tell my why the "wrong" scope gets called after writing the dot and pressing Strg+SPACE and what I can do to get the context assist working for my use case?

Thomas
Re: dot notation and scoping [message #1073392 is a reply to message #1073391] Wed, 24 July 2013 13:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 5849
Registered: July 2009
Senior Member
Hi,

Xtext create objects lazy thus the econtainer of the actual object might be the context.
Re: dot notation and scoping [message #1073394 is a reply to message #1073392] Wed, 24 July 2013 13:13 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 5849
Registered: July 2009
Senior Member
btw did you have a look at
http://christiandietrich.wordpress.com/2013/05/18/xtext-and-dot-expressions/
Previous Topic:Easy way of checking for duplicate name in a resource while using JvmModelInferrer?
Next Topic:org.eclipse.xtext.ecore
Goto Forum:
  


Current Time: Sun Apr 20 04:21:43 EDT 2014

Powered by FUDForum. Page generated in 0.02502 seconds