Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.1] Fully qualified names export and ScopeProvider
[Xtext 2.1] Fully qualified names export and ScopeProvider [message #759826] Wed, 30 November 2011 08:51 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
In my DSL, I'm exporting my elements using fully qualified names. In my workflow file, I have this:

fragment = exporting.QualifiedNamesFragment {}


This works fine and my types are now accessible through a qualified name. But if I provide some scoping rules on elements (adding a IScope scope_XXXX method in my XXXXScopeProvider), the elements which are returned by this method are only accessible through simple names and not fully qualified names anymore.

What is the reason for that and how can I fix this ?
Re: [Xtext 2.1] Fully qualified names export and ScopeProvider [message #759829 is a reply to message #759826] Wed, 30 November 2011 09:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi,

you atre doing that yourself. see

org.eclipse.xtext.scoping.Scopes.scopeFor(Iterable<? extends EObject>, IScope)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext 2.1] Fully qualified names export and ScopeProvider [message #759835 is a reply to message #759829] Wed, 30 November 2011 09:26 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
I'm indeed calling Scopes.scopeFor(Iterable<? extends EObject> elements) and I'm not really sure what the code does after that. As far as I understood, the element is exported using it's simple name and I didn't see a way to change that easily.
How can I export my elements using FQN in the scope ?
Re: [Xtext 2.1] Fully qualified names export and ScopeProvider [message #759839 is a reply to message #759835] Wed, 30 November 2011 09:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
call

org.eclipse.xtext.scoping.Scopes.scopedElementsFor(Iterable<? extends T>, Function<T, QualifiedName>)
with your iqualifiednameprovider and not QualifiedName.wrapper(SimpleAttributeResolver.NAME_RESOLVER)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext 2.1] Fully qualified names export and ScopeProvider [message #759842 is a reply to message #759839] Wed, 30 November 2011 09:39 Go to previous message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Thanks it works fine. I didn't see that IQualifiedNameProvider extends Function<EObject, QualifiedName>.
Previous Topic:Parsing large files
Next Topic:qulified names
Goto Forum:
  


Current Time: Wed Apr 24 15:01:03 GMT 2024

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

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

Back to the top