References from other file not working [message #1006177] |
Wed, 30 January 2013 06:02  |
Eclipse User |
|
|
|
I have a simple json grammer that has support for referencing to "named object" by using the "uses" attribute.
grammar com.example.Json with org.eclipse.xtext.common.Terminals
generate json "http://eclipse.org"
Object:
'{'
(members+=Member)?
(',' members+=Member)*
'}';
Member:
GenericMember | NamedMember | UsesMember;
GenericMember:
key=STRING ':' name=Value;
NamedMember:
key='\"name\"' ':' name=STRING;
UsesMember:
key='\"uses\"' ':' name=[NamedMember | STRING];
Value:
Object | STRING | Array | Boolean | Null | Number;
Array:
'[' (values+=Value)? (',' values+=Value)* ']';
Boolean:
'true' | 'false';
Null:
'null';
terminal Number:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
An example of the json:
{
"obj1": {
"name": "name1"
},
"obj2": {
"uses": "name1"
}
}
The content assistance only displays the named object of the current file.
From what I can tell from the video the cross file referencing should work out of the box.
I tried changing my workflow but without success:
// scoping and exporting API
fragment = scoping.ImportURIScopingFragment {}
fragment = exporting.SimpleNamesFragment {}
// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}
fragment = builder.BuilderIntegrationFragment {}
I am a bit lost as to where I should start fixing this.
Most tutorials are about how to change the scoping behaviour but not on how to allow scoping cross file without any imports.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.29286 seconds