Couldn't find property of an imported type [message #641476] |
Thu, 25 November 2010 15:37 |
|
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 |
|
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 |
|
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
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.01905 seconds