Xtend cannot see methods in Xtext's generated classes [message #1576997] |
Wed, 21 January 2015 16:57  |
Eclipse User |
|
|
|
Hi all,
From a Simple.mydsl file, I generate some Java classes using a custom JvmModelInferrer. The project A that contains my DSL files is an Eclipse plugin that exports the Java packages generated in src-gen/.
Now, I want to use these generated classes in some other project B.
The situation is as follows:
(1) If I create a new Java project B in the same Eclipse instance and put A either as a plugin dependency or as a buildpath "Required project" dependency, everything's ok. I see the generated classes and method autocompletion on them works in both Xtend and Java files.
(2) If I run a new Eclipse instance (with A included) and create a new Java project B with A as a plugin dependency, new Java files can access the types and autocomplete methods, whereas new Xtend files can import the type, but they see no methods (no autocompletion, and error if manually written)!
I guess this as something to do with the exported EObjectDescriptions, or the way Xtend directly communicate with a model of the Jvm rather than the actual generated classes?
Thanks for you help,
Cioran
|
|
|
|
|
Re: Xtend cannot see methods in Xtext's generated classes [message #1577021 is a reply to message #1577014] |
Wed, 21 January 2015 17:14   |
Eclipse User |
|
|
|
Of course, if I manually move the packages in src-gen/ to a new Java Project, I can import the new project in a new Eclipse instance and everything works.
Also, this may be related to the fact that, although the import statement works in Xtend files, if I ctrl+click on it, Eclipse tries to run an Editor for my DSL, and not a Java editor (because of the IJvmModelAssociator I guess). Unfortunately, editor fails with: "java.lang.IllegalArgumentException: Couldn't create EMF Resource for input org.eclipse.jdt.internal.ui.javaeditor.InternalClassFileEditorInput@9122e6e6").
[Updated on: Wed, 21 January 2015 17:33] by Moderator Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04791 seconds