I'm not quite sure I understand how the scoping process works in xText, working with several model files.
Referencing within one file works fine, just having to specify a rule along the lines of ref=[referencedObject | ID], I can get the auto completion to work out of the box ; however, I can't seem to access any EObject in another file. The information I found is not very explicit about that case, and I don't really understand what I am supposed to do to make it work...
I tried referencing by QualifiedName, but I simply don't get where I'm supposed to make the reference actually happen - how my separate files can access each other.
EDIT : code
File returns File:
UIRule | EventRule
;
QualifiedName:
ID ('.' ID)*
;
/* First file */
UIRule returns Ui:
{Ui}
"ui"
(screens+=ScreenRule (screens+=ScreenRule)*)?
;
ScreenRule returns Screen:
name=ID "as" "screen"
'{'
(elements+=GUIElementRule )*
'}'
;
GUIElementRule returns Button:
name=ID "as" "element"
;
/* Second file */
EventRule returns Event:
{Event}
"event"
rules+=RuleRule*
;
RuleRule returns Rule:
"on" "{" on=ButtonPressRule "}"
"do" "{" do=ActionRule "}"
;
ButtonPressRule returns Pressed:
"press" "[" source=[GUIElement | QualifiedName] "]"
;
ActionRule returns Open:
"open" "[" screen=[Screen | QualifiedName] "]"
;