Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xcore] Does Xcore support references to external Ecore models?(As an example, I cannot get a reference to EObject resolved)
[Xcore] Does Xcore support references to external Ecore models? [message #1823230] Mon, 23 March 2020 10:44 Go to next message
Wernke zur Borg is currently offline Wernke zur BorgFriend
Messages: 42
Registered: December 2011
Member
I am trying to migrate an existing Xtext project to Xcore, for more flexibility with the model. But it appears that existing references to external Ecore models do not get resolved in Xcore.

Simplified example with my concrete reference replaced with a reference to EObject:
class Foo {
    refers org.eclipse.emf.ecore.EObject ref
}


Error in the Xcore editor:
Multiple markers at this line
- The generic reference type must not refer to a data type
- org.eclipse.emf.ecore.EObject cannot be resolved to a type.


With this simplified example, the Mwe2 workflow runs through without error, but for the reference to EObject it generates a reference to java.lang.Object, which of course results in Java errors.

In my real case, the reference to an own Ecore model also fails in the Mwe2 workflow with
XtextLinkingDiagnostic: null:31 my.concrete.reference.Class cannot be resolved to a type.


Both org.eclipse.emf.ecore and the bundle with my.concrete.reference.Class are specified as dependencies in the Manifest.

Either I am missing another dependency somewhere or Xcore does not support references to Ecore models.

Thanks for any hints,
Wernke
Re: [Xcore] Does Xcore support references to external Ecore models? [message #1823235 is a reply to message #1823230] Mon, 23 March 2020 11:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi, have a look at https://github.com/cdietrich/xtext-ecore-xcore shows that this does work.
unfortunately i dont have time to give you more hints than that.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xcore] Does Xcore support references to external Ecore models? [message #1823243 is a reply to message #1823235] Mon, 23 March 2020 14:30 Go to previous message
Wernke zur Borg is currently offline Wernke zur BorgFriend
Messages: 42
Registered: December 2011
Member
Thank you Christian, I can value your short replies, and the code says more than 1000 words ;)

My Mwe2 workflow was missing a reference to the GenModel of the external Ecore model, which Xtext does not need but Xcore does need for resolving references.

...
        language = StandardLanguage {
            ...
            referencedResource = "platform:/resource/my/external/model/some.genmodel"
            ...
Previous Topic:What unix stream do INFO and WARNING Messages Use?
Next Topic:Xtext YAML Grammar
Goto Forum:
  


Current Time: Fri Apr 26 20:38:51 GMT 2024

Powered by FUDForum. Page generated in 0.03288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top