[xcore][xtend] [message #1792269] |
Fri, 13 July 2018 17:39 |
Maged Elaasar Messages: 23 Registered: September 2013 |
Junior Member |
|
|
Hi all,
I am running into a bizarre problem that I would appreciate help with. I created a simpler example that I can describe here (sources attached).
I have a simple Xcore model (test.xcore) that generates code in (test and test.edit) plugins (both in "src-gen" folder). I needed to do some changes to the generated ItemProviders in the test.edit plugin, but instead of hijacking the generated ItemProvider classes (e.g., Class1ItemProvider) with generated NOT annotation, I want to create subclasses of the ItemProviders (e.g., Class1ItemProviderEx) in a "src" folder. I decided to write such subclasses in Xtend, so I added the xbase lib to the edit plugin's dependencies.
here is how my Class1ItemProviderEx.xtend look like:
package test.provider
import org.eclipse.emf.common.notify.AdapterFactory
class Class1ItemProviderEx extends Class1ItemProvider {
new(AdapterFactory adapterFactory) {
super(adapterFactory)
}
}
The problem is that the Xtend class is confused about the constructor and methods inherited from the Xcore-generated ItemProvider class. For example, I get the following compliation error:
"No default constructor in super type Class1ItemProvider. Another constructor must be invoked explicitly. Class1ItemProviderEx.xtend /test.edit/src/test/provider."
One thing I also noticed is that when I navigate from the ClassItemProvider in the .Xtend class to its type definition (by hovering and clicking the hyperlink), it takes me to the xcore file (test.xcore) as opposed to the Java Class (Class1ItemProvider). Not sure if this is a clue or not. Also, when I uninstall the Xcore plugins from the dev IDE, the problem disappears. So, it looks to me that it's an interaction between Xcore and Xtend.
I would appreciate your input on this.
Thanks,
Maged
-
Attachment: test.zip
(Size: 43.01KB, Downloaded 67 times)
|
|
|
|
Powered by
FUDForum. Page generated in 0.05010 seconds