I'm very confused about how I should manage the resource set so that cross references to resources in another file are resolved correctly (specifically for an xbase grammar). I am using an Eclipse xtext project to manage resources, but I know I need to populate the resource set manually if I were to use the standalone entry point.
I have an XBase grammar along the lines of:
grammar com.example.MyDsl with org.eclipse.xtext.xbase.Xbase
Model:
imports=XImportSection?
namespace=Namespace
;
Namespace:
'package' name=QualifiedName ';'?
(elements+=Element)+
;
Element:
T1 | T2
;
't1' name=ValidID '{' '}' ;
't2' name=ValidID '{'
ref=[Element|QualifiedName]
'}' ;
Then say I have file 1 with:
and file 2 with:
import test.foo;
package test;
t2 bar{ foo }
Right now I have both file 1 and file 2 inside an Eclipse src folder xtext project and both elements are inferred to classes with a JVMInferrer.
I find that often the refence to foo is an unresolved proxy, which causes a "org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator - Error calling inferrer" error, but then compilation actually succeeds anyway.
Do I need to create a custom global scope provider?