[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2t] resolving cross-references to imported model in xpand/xtend

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