Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Custom ScopeProvider + FilteringScope and Proxy Resolution ?
Custom ScopeProvider + FilteringScope and Proxy Resolution ? [message #897108] Sat, 21 July 2012 21:57 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
I'm having the same problem stated here:.

I'm getting null value when trying to get a value of a feature of input.getEObjectOrProxy() in method below.

In the linked forum post, the suggestion id to create a custom ResourceDescriptionManager + ResourceDescriptionManager.
But in actual xtext version I couldn't find a bindIResourceDescriptionsManager() method.

There a new way to deal with this problem?

thanks,

Cristiano

public IScope scope_UnitInstance_superType(UnitInstance context,
			EReference reference) {
		IScope scope = delegateGetScope(context, reference);
		return new FilteringScope(scope, new Predicate<IEObjectDescription>() {
			public boolean apply(IEObjectDescription input) {
				if (input != null
						&& input.getEObjectOrProxy() instanceof UnitType) {
					return input
							.getEObjectOrProxy()
							.eGet(SoftwareLibraryDslPackage.eINSTANCE
									.getAbstractLibraryElement_Abstract())
							.equals(Boolean.FALSE);
				}
				return false;
			};
		});
	}
Re: Custom ScopeProvider + FilteringScope and Proxy Resolution ? [message #897109 is a reply to message #897108] Sat, 21 July 2012 22:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i doubt it is a good idea to resolve stuff during scoping.

the hooks for index stuff
are:
- org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy.createEObjectDescriptions(EObject, IAcceptor<IEObjectDescription>)
- and for the local resource org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.internalGetAllDescriptions(Resource)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Custom ScopeProvider + FilteringScope and Proxy Resolution ? [message #897112 is a reply to message #897109] Sat, 21 July 2012 23:08 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
I'm supposing that I need to create custom classes that extends DefaultResourceDescriptionStrategy and ImportedNamespaceAwareLocalScopeProvider.

But I can find methods in Abstract<myLang>RuntimeModule to override.

Could you please point where and how could I bind them ?

thanks

Cristiano
Re: Custom ScopeProvider + FilteringScope and Proxy Resolution ? [message #897126 is a reply to message #897112] Sun, 22 July 2012 07:36 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

what about not to override but simply to create the binding method? there is no reason not to do this.
google is your friend:
http://www.eclipse.org/forums/index.php/mv/msg/361362/885861/#msg_885861

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Newbie: JVMModelInferrer, extend class from third-party-lib
Next Topic:MWE2 workflow with xpand2.Generator and Beautifier fails
Goto Forum:
  


Current Time: Thu Apr 25 13:59:41 GMT 2024

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

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

Back to the top