|
Re: IScopeProvider interface improvement [message #714878 is a reply to message #714850] |
Thu, 11 August 2011 16:08 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Mark,
there is already an IScopeProviderDelegate in the 2.1 stream which is
used in the instanceof checks instead of the concrete implementation
classes.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 11.08.11 17:40, Mark Christiaens wrote:
> I wanted to make a suggestion regarding the IScopeProvider interface.
> Currently, this interface just consists of:
>
> IScope getScope(EObject context, EReference reference);
>
> However, in the DefaultLinkingService there is this code:
>
> protected void registerImportedNamesAdapter(IScopeProvider
> scopeProvider, EObject context) {
> if (scopeProvider instanceof AbstractGlobalScopeDelegatingScopeProvider) {
> AbstractGlobalScopeDelegatingScopeProvider provider =
> (AbstractGlobalScopeDelegatingScopeProvider) scopeProvider;
> ImportedNamesAdapter adapter = getImportedNamesAdapter(context);
> provider.setWrapper(adapter);
> } else if (scopeProvider instanceof AbstractDeclarativeScopeProvider) {
> AbstractDeclarativeScopeProvider declarativeScopeProvider =
> (AbstractDeclarativeScopeProvider) scopeProvider;
> registerImportedNamesAdapter(declarativeScopeProvider.getDelegate(),
> context);
> }
> }
>
> This code is responsible for enabling figuring out what the
> IEObjectDescription dependencies between resources are during linking.
> If you just implement a new IScopeProvider based on the interface none
> of the above code will be triggered and incremental linking will be broken.
> So, to me it seems that it never makes sense to implement an
> IScopeProvider without deriving it from
> AbstractGlobalScopeDelegatingScopeProvider or
> AbstractDeclarativeScopeProvider.
> I would suggest to add to the IScopeProvider a method to obtain the
> delegate (or null if it doesn't exist) and to introduce a
> IGlobalScopeProvider with a setWrapper method. That should lead future
> implementations along the right path.
> ---
> Mark Christiaens
> Discover the Future of VHDL Design
> Go to http://www.sigasi.com
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03134 seconds