Xtext grammar autocompletion [message #1809343] |
Sat, 13 July 2019 14:03  |
Eclipse User |
|
|
|
I have the following Xtext grammar :
ClassA :
'object' name=ID ('['declareNumberOfObjects=INT']')? ':' typeObjectA=TypeObjectA
;
ClassB :
'object' name=ID ':' typeObjectB=TypeObjectB
;
ClassC :
'object' name=ID ':' typeObjectC=TypeObjectC
;
TypeObjectA :
objectAToInstantiate=[ObjectA] 'platform' targetedPlatform=('TYPE1'|'TYPE2')
;
TypeObjectB :
objectBToInstantiate=[ObjectB] 'platform' targetedPlatform=('TYPE3'|'TYPE4')
;
TypeObjectC :
objectCToInstantiate=[ObjectC] 'platform' targetedPlatform=('TYPE5'|'TYPE6')
;
But I don't understand why when I arrive to the keyword 'platform' the autocompletion proposes me all TYPES (i.e TYPE1, TYPE2, TYPE3...etc) without taking into account the fact that I am in ClassA or ClassB or ClassC.
What I want is that if I am in ClassA the platform proposed would be TYPE1 or TYPE2 that's it, same for ClassB i.e TYPE3 or TYPE4...etc
Why this syntax does not achieve that and how can I achieve it ?
Regards
[Updated on: Sat, 13 July 2019 14:04] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04491 seconds