Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Recursive imports in xtext
Recursive imports in xtext [message #1016482] Wed, 06 March 2013 15:49 Go to next message
Mathieu MONTIN is currently offline Mathieu MONTINFriend
Messages: 26
Registered: October 2012
Junior Member
Hi everyone,

Does anyone know how to make imports recursive / transitive using xtext ?
And first of all : is that even possible ?

Thank you. Razz
Re: Recursive imports in xtext [message #1016613 is a reply to message #1016482] Thu, 07 March 2013 07:11 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

it does not work out of the box. You have to implement this functionality yourself. Do you work with name space imports (in which case transitive imports do not make sense to me) or URI imports?

In the second case, the corresponding base class to extend has a handy method for providing implicit imports.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Recursive imports in xtext [message #1016953 is a reply to message #1016482] Fri, 08 March 2013 10:34 Go to previous messageGo to next message
Mathieu MONTIN is currently offline Mathieu MONTINFriend
Messages: 26
Registered: October 2012
Junior Member
Hello,

As you assumed, I work with imported URIs.

Which is the class you are talking about ?

I don't get why the implicits import will help me. Should I define some kind of implicit imports depending on the file ? I suppose I could browse the model recursively and make the appropriate scope.

Thank's for your answer.
Re: Recursive imports in xtext [message #1017212 is a reply to message #1016953] Mon, 11 March 2013 07:42 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

sorry my last answer was technically incorrect. The method for implicit imports exists for name space imports. For URI-imporst you adapt ImportUriGlobalScopeProvider#getImportedUris.

And yes, you would recursively go through the imported models in order to collect all imports.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:How to display ecore Eclass names for content assist in Xtext editor after generating artifacts ?
Next Topic:Xtype: JvmTypeReference not working as wanted (validation, scope)
Goto Forum:
  


Current Time: Fri Apr 26 17:23:08 GMT 2024

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

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

Back to the top