|
|
|
|
Re: [Xtext] scope provider migration - DI issue? [message #1062068 is a reply to message #1061976] |
Wed, 05 June 2013 16:26 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
If you look in the abstract runtime module for bindings related to Scope
you should find 1) what bindings are needed and 2) which (super)classes
you must ensure to call from your own classes. I use Xbase and have the
following bindings:
I a similar migration and now use the following bindings:
// originally contributed by
org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public Class<? extends org.eclipse.xtext.scoping.IScopeProvider>
bindIScopeProvider() {
return org.ptolemy.xtext.scoping.XActorScopeProvider.class;
}
// originally contributed by
org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public Class<? extends
org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider>
bindXbaseBatchScopeProvider() {
return org.ptolemy.xtext.scoping.XActorBatchScopeProvider.class;
}
// contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public void configureSerializerIScopeProvider(com.google.inject.Binder
binder) {
binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class).annotatedWith(org.eclipse.xtext.serializer.tokens.SerializerScopeProviderBinding.class).to(org.ptolemy.xtext.scoping.XActorSerializerScopeProvider.class);
}
Hallvard
On 05.06.13 01.25, Volker Wegert wrote:
> Am 05.06.2013 09:56, schrieb Christian Dietrich:
> > Which is the version you are coming from (you may have a look at mig
> guides in docs)
>
> I'm upgrading from 2.2.1.v201112130541 to 2.4.1.v201304180855.
>
> > (you may have a look at mig guides in docs)
>
> http://www.eclipse.org/Xtext/documentation.html only provides migration
> guides from 0.7 to 1.0 and from 1.0 to 2.0. So do the online
> documentation and the PDF documentation supplied from the site.
>
> > XBase/no Xbase what is the error you get.
>
> Without changes to MyDSLRuntimeModule, the scope provider is simply not
> called (no error message, references are not resolved in the editor).
>
> If I add this to MyDSLRuntimeModule
>
> @Override
> public Class<? extends IScopeProvider> bindIScopeProvider() {
> return de.mycompany.mydsl.scoping.MyDSLScopeProvider.class;
> }
>
> I get the following error messages
>
> !MESSAGE de.mycompany.mydsl.ui.internal.MyDSLActivator - Failed to
> create injector for de.mycompany.mydsl.MyDSL
> 6 [main] ERROR de.mycompany.mydsl.ui.internal.MyDSLActivator - Guice
> creation errors:
> 1) No implementation for org.eclipse.xtext.scoping.IScopeProvider
> annotated with
> @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegate)
> was bound.
> while locating org.eclipse.xtext.scoping.IScopeProvider annotated
> with
> @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegate)
>
> for field at
> org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegate(Unknown
> Source)
> at
> org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)
>
>
> From this, I assumed that extending the RuntimeModule is not the way to
> go - but what is it, then?
>
> > Besides this it may help to create a new project with the wizard and
> > compare.
>
> The new project does not contain any scope provider at all, so I'm stuck
> with the same question - how do I get the runtime to use my scope
> provider? The documentation is really cool and goes to great lengths to
> explain how to do the most complex tasks, but apparently I've overlooked
> the part where it tells me how to do the basic stuff first...
>
> Thanks
> Volker
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03452 seconds