Community
Participate
Working Groups
Build Identifier: M20100909-0800 Xtext User Guide has a Xpand template with a bug. It is in this section: http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html#getting-started-xpand The template you suggest ist: «IMPORT org::eclipse::xtext::example::domainmodel» «EXTENSION templates::Extensions» «DEFINE main FOR Entity-» «FILE qualifiedName().replaceAll("\\.","/")+".java"-» package «packageName()»; public class «name» { «EXPAND property FOREACH features» } «ENDFILE» «ENDDEFINE» «DEFINE property FOR Feature» private «type.referenced.qualifiedName()» «name»; public void set«name.toFirstUpper()»( «type.referenced.qualifiedName()» «name») { this.«name» = «name»; } public «type.referenced.qualifiedName()» get«name.toFirstUpper()»() { return «name»; } «ENDDEFINE» but this template does not recognize the extends expression of the language. That means that Speaker does not extend Person when you generate the code. The teamplate should be modified to this: «IMPORT org::eclipse::xtext::example::domainmodel» «EXTENSION templates::Extensions» «DEFINE main FOR Entity-» «FILE qualifiedName().replaceAll("\\.","/")+".java"-» package «packageName()»; public class «name»«IF superType != null» extends «superType.name»«ENDIF» { «EXPAND property FOREACH features» } «ENDFILE» «ENDDEFINE» «DEFINE property FOR Feature» private «type.referenced.qualifiedName()» «name»; public void set«name.toFirstUpper()»( «type.referenced.qualifiedName()» «name») { this.«name» = «name»; } public «type.referenced.qualifiedName()» get«name.toFirstUpper()»() { return «name»; } «ENDDEFINE» Reproducible: Always Steps to Reproduce: 1. Do the tutorial: http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html#getting-started-xpand 2. generate the java classes and look at the Speaker class 3. notice that it does not extend Person
Fixed in HEAD.
Closing all bugs that were set to RESOLVED before Neon.0