Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with get xtext resource for Xtend's doGenerate
Problem with get xtext resource for Xtend's doGenerate [message #896663] Thu, 19 July 2012 10:28 Go to next message
Andrea Margheri is currently offline Andrea MargheriFriend
Messages: 20
Registered: July 2012
Junior Member
Hi,
in my DSL I have import statement and when doGenerate was called I want to generate code also for imported file. I need to use xtextResourceSet from my xtend file, but
there are any resources available from XtextResourceSet.

My xtend code is:
var Injector injector = new xacmlStandaloneSetup().createInjectorAndDoEMFRegistration();

var XtextResourceSet set = injector.getInstance(XtextResourceSet.class);
   					
var URI uri = URI::createPlatformResourceURI(i.importURI,true);

var Resource res = set.getResource(uri,false)


Why other xtext resources aren't visible? Even if global scoping run correctly.
Otherwise if you know other way to compile imported file thanks in advance.
Re: Problem with get xtext resource for Xtend's doGenerate [message #896677 is a reply to message #896663] Thu, 19 July 2012 11:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13423
Registered: July 2009
Senior Member
Hi you have to add all resources to the resource set yourself. Then
there is https://bugs.eclipse.org/bugs/show_bug.cgi?id=382555
~Christian

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with get xtext resource for Xtend's doGenerate [message #896694 is a reply to message #896677] Thu, 19 July 2012 12:05 Go to previous message
Andrea Margheri is currently offline Andrea MargheriFriend
Messages: 20
Registered: July 2012
Junior Member
It runs! Thanks very much Christian!
Previous Topic:Xtext sometimes fails to resolve references in global scope
Next Topic:Need help with Contentassist
Goto Forum:
  


Current Time: Sun Apr 05 07:05:57 GMT 2020

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

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

Back to the top