Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Couldn't find property of an imported type(Property is not resolved in xpt when the type is an important type)
Couldn't find property of an imported type [message #641476] Thu, 25 November 2010 15:37 Go to next message
Iyigun Cevik is currently offline Iyigun CevikFriend
Messages: 2
Registered: November 2010
Location: Vienna
Junior Member

I have two xtext files, one imports the other:

import 'classpath:/com/bwin/cpi/dsl/SdmDsl.ecore' as dmodel


I defined a type which has a property ("businesstype") imported from the other xtext:
Projection:
	"=>" businesstype=[dmodel::BusinessType]
		("exclude" exclusions+=[dmodel::Feature]


In the xpt file Projection object doesn't have a businesstype field. Editors shows an error: "Couldn't find property 'businesstype' for type 'List' or inner type 'sdmDslInterface::Projection'". Autocompletion shows that "exclusions" is resolved as "List[unknown]".

When I have all types in the same language (xtext file), there are no problems.

Is there anything I'm missing?

Iyigun
Re: Couldn't find property of an imported type [message #641524 is a reply to message #641476] Thu, 25 November 2010 19:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,
i think this is cause the generator project is missing the SdmDslmetamodel.

first: the imports in your xpand file should match the one that is configured in your generator projects Xtend/Xpand properties.

Then:
- If you are using the Java Beans Metamodel just add a Plugin Dep from the Generator Project to SdmDsl Model Classes plugin.
- If you are using (dynamic) emf in the generator then add dmDsl.ecore to the classpath of the generator project.


Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Couldn't find property of an imported type [message #641926 is a reply to message #641524] Mon, 29 November 2010 09:38 Go to previous message
Iyigun Cevik is currently offline Iyigun CevikFriend
Messages: 2
Registered: November 2010
Location: Vienna
Junior Member

Hi Christian,
I checked my imports one more time. It looks like when I put all definitions in one xpt file, I can successfully generate files. If I separate them into two xpt files in same folder, I get an "No Definition '...' found!" error.

when I put my templates into a single file, generation works, however editor shows error message on the imported types as I explained before. Code completion doesn't work neither.

My workflow looks like this:
module workflow.SdmDslGenerator

import org.eclipse.emf.mwe.utils.*

var targetDir = "src-gen"
var fileEncoding = "UTF-8"
var modelPath = "src/model"

Workflow {

	component = org.eclipse.xtext.mwe.Reader {
		path = modelPath
		register = com.bwin.cpi.dsl.SdmDslStandaloneSetup {}
		load = {
			slot = "services"
			type = "Service"
		}
		register = com.bwin.cpi.dsl.SdmDslInterfaceStandaloneSetup {}
		load = {
			slot = "contracts"
			type = "Contract"
		}
	}

	component = org.eclipse.xpand2.Generator {
		metaModel = org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel {}
		expand = "templates::Template::main FOREACH services"		
		outlet = {
			path = targetDir
		}
		fileEncoding = fileEncoding
	}
	component = org.eclipse.xpand2.Generator {
		metaModel = org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel {}
		expand = "templates::Template::main2 FOREACH contracts"		
		outlet = {
			path = targetDir
		}
		fileEncoding = fileEncoding
	}	
}
Previous Topic:the content assist failure
Next Topic:Slow generation outside Eclipse
Goto Forum:
  


Current Time: Thu Apr 18 00:16:55 GMT 2024

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

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

Back to the top