cann't reference the instance in jar file or classpath model [message #1690101] |
Wed, 25 March 2015 05:20  |
Eclipse User |
|
|
|
Hi all,
I have a problem regarding to Global Scoping.
I define a xtext model as follow:
ModuleDeclaration:
'Module' name= QualifiedName id=INT
;
PackageDeclaration:
'package' name = [ModuleDeclaration | QualifiedName]
;
I want refer the instance of module defined in a jar file. but which doesn't work.
for details.
Project 1 define one model file.
model1.dal:
then, I export the file to a module1.jar file, which just includes this one file
Project 2 define another model file.
model2.dal:
Project2 define a new model file.
add model1.jar and add require project2
package.dal:
the content assist only list "Product" model, doesn't list 'Account'
that is to say, XText cross reference from jar does not work as said in XText document.
Quote:To enable support for this kind of global scoping in Xtext, a DefaultGlobalScopeProvider has to be bound to the IGlobalScopeProvider interface. By default Xtext leverages the class path mechanism since it is well designed and already understood by most of our users. The available tooling provided by JDT and PDE to configure the class path adds even more value. However, it is just a default: you can reuse the infrastructure without using Java and be independent from the JDT.
what should I do?
Should I customize the scope like this?
def scope_ModuleDeclaration(PackageDeclaration context, EReference ref)
{
//parser all jar and build scope
}
the XText version is 2.7.3 I used.
Thanks!
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04041 seconds