Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » resolving cross-references to imported model in xpand/xtend
resolving cross-references to imported model in xpand/xtend [message #480306] Fri, 14 August 2009 17:01 Go to next message
Edwin Park is currently offline Edwin Park
Messages: 124
Registered: July 2009
Senior Member
Hi,

I'm trying to use xtext to create an entity model and a separate gui model
that references the entity model.

I created two simple of xtext projects to demonstrate this issue:

model.entity
model.entity.generator
model.entity.ui

model.gui
model.gui.generator
model.gui.ui

The entity project just has the standard unmodified example xtext model.

The Gui.xtext file looks like:

grammar model.Gui with model.Entity

generate gui "http://www.Gui.model"

import "http://www.Entity.model"

GuiModel :
(imports+=Import)*
'gui' entity=[Entity];

The model.gui.generator project has a MyModel.gui file that looks like:

import "classpath:/model/MyModel.entity"

gui Leaf

The problem I'm running into is that the Xpand and Xtend files in my
model.gui.generator project are unable to see the entity cross-reference
in the GuiModel.

I have an Extensions.ext file:

import entity;
import gui;

Entity getEntity(GuiModel this) :
this.entity;

Eclipse reports "Couldn't find property 'entity' for type 'gui::GuiModel'"

I get the same error in my xpt file when referencing the entity property
of GuiModel.

The funny thing is that I am able to run generation successfully from the
mwe workflow, so the workflow is able to resolve this cross-reference just
fine. It is just the xpand/xtend editors in the dependent
model.gui.generator project that don't work properly. Can anyone tell me
what I might be doing wrong? Or is this a bug with the tooling?

Thanks,
Edwin
Re: resolving cross-references to imported model in xpand/xtend [message #480307 is a reply to message #480306] Fri, 14 August 2009 17:06 Go to previous messageGo to next message
Edwin Park is currently offline Edwin Park
Messages: 124
Registered: July 2009
Senior Member
One other thing I found, which may be a clue or may be nothing - if I open
the model.gui/src-gen/model/Gui.ecore model file in the Sample Ecore Model
Editor and try to navigate to the entity property under GuiModel, I get an
error: FileNotFoundException http://www.Entity.model

Edwin
Re: resolving cross-references to imported model in xpand/xtend [message #480324 is a reply to message #480307] Fri, 14 August 2009 22:02 Go to previous messageGo to next message
Edwin Park is currently offline Edwin Park
Messages: 124
Registered: July 2009
Senior Member
A zipfile containing these projects is here:
http://esp1.freeshell.org/model_projects.zip

Thanks,
Edwin
Re: resolving cross-references to imported model in xpand/xtend [message #480373 is a reply to message #480324] Sun, 16 August 2009 07:05 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Edwin,

this seems to be a bug. The Xtend editor should work fine if you install
the entity Ecore model into your eclipse instance or edit the Xtend file
in a runtime workbench. However, I think the Xtend editor should resolve
the meta model in the development workspace as well.
Would you please be so kind and file a bugzilla ticket?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 15.08.09 04:02, schrieb Edwin Park:
> A zipfile containing these projects is here:
> http://esp1.freeshell.org/model_projects.zip
>
> Thanks,
> Edwin
>
Re: resolving cross-references to imported model in xpand/xtend [message #480408 is a reply to message #480373] Sun, 16 August 2009 18:47 Go to previous message
Edwin Park is currently offline Edwin Park
Messages: 124
Registered: July 2009
Senior Member
Filed bugzilla here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=286745

Thanks,
Edwin
Previous Topic:how to query xmi model-file
Next Topic:Run JET template from java error
Goto Forum:
  


Current Time: Tue Jul 22 21:44:08 EDT 2014

Powered by FUDForum. Page generated in 0.01852 seconds