Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtend doesn't resolve extension methods
Xtend doesn't resolve extension methods [message #752540] Wed, 26 October 2011 12:31 Go to next message
Nadezhda Baklanova is currently offline Nadezhda BaklanovaFriend
Messages: 9
Registered: October 2011
Junior Member
Hi all,

I'm trying to generate some xml from my DSL. Xtend compiler lists several problems like Couldn't resolve reference to JvmIdentifiableElement 'allContentsIterable'.
and so on about every non-keyword statement. However, Eclipse context helper shows javadoc for 'allContentsIterable' correctly. The rows are marked with x in grey circle (not x in red circle as usual compiler errors) - this seems to be very weird.
Is it a compiler issue or I'm missing something?

Xtend generator file is
package mymodel.generator

import mymodel.annotations.*
import org.eclipse.emf.ecore.resource.*
import org.eclipse.xtext.generator.*
import static extension org.eclipse.xtext.xtend2.lib.ResourceExtensions.*
import org.eclipse.xtext.xtend2.lib.*
import com.google.inject.*
import org.eclipse.xtext.xtend2.*
import com.google.common.*
import org.eclipse.xtext.naming.*

class AnnotationsGenerator implements IGenerator {
	@Inject extension IQualifiedNameProvider nameProvider	
	override void doGenerate(Resource resource, IFileSystemAccess fsa) {		
		for(m: resource.allContentsIterable.filter(typeof(Method))){
			for(s: m.methodBody.statement){
				fsa.generateFile(m.fullyQualifiedName.toString.replace(".","/") + ".xml",s.compile)
			}
		}			
	}
	
	def compile(Statement s)'''
		
	'''	
}
Re: Xtend doesn't resolve extension methods [message #752609 is a reply to message #752540] Wed, 26 October 2011 13:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

maybe a clean build helps. if there is xtend2.lib is on the path,
then it will/should work

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 26 October 2011 13:00]

Report message to a moderator

Re: Xtend doesn't resolve extension methods [message #752654 is a reply to message #752609] Wed, 26 October 2011 13:20 Go to previous message
Nadezhda Baklanova is currently offline Nadezhda BaklanovaFriend
Messages: 9
Registered: October 2011
Junior Member
Christian Dietrich wrote on Wed, 26 October 2011 09:00

maybe a clean build helps. if there is xtend2.lib is on the path,
then it will/should work


thank you, Christian! after clean build and adding an explicit import of IQualifiedNameProvider it works.
Previous Topic:resolve cross-reference in LabelProvider
Next Topic:Formatting preservation for non-containment multivalued features and multivalued attributes
Goto Forum:
  


Current Time: Thu Apr 25 23:10:16 GMT 2024

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

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

Back to the top