ScopeProvider in xtext 2.2.1 [message #842620] |
Thu, 12 April 2012 13:08 |
Goran M. Messages: 12 Registered: April 2012 |
Junior Member |
|
|
Hi,
can somebody please tell me how I can configure my own ScopeProvider?
I found thousands of code snippets how a ScopeProvider looks like, but I cannot
find where I have to configure it, to be accessible... :?
I created a Xtext-project (2.2.1) with eclipse. I wrote my DSL and executed "Run as..."
I have no individual ScopeProvider class like the individual ProposalProvider class.
So, if I implement the IScope interface, somehow I have to configure that I got
an individual ScopeProvider...but where?????
I tried the DSL-RuntimeModule class and I have overridden the configure-method:
@Override
public void configure(Binder binder) {
super.configure(binder);
binder.bind(IScopeProvider.class).to(BiproScopeProvider.class);
}
But if I start the other eclipse workbench I got an exception:
1 [main] ERROR de.gwvs.bipro.scripting.editor.ui.BiproScriptExecutableExtensionFactory - com.google.common.util.concurrent.UncheckedExecutionException: com.google.inject.CreationException: Guice creation errors:
1) A binding to org.eclipse.xtext.scoping.IScopeProvider was already configured at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55).
at de.gwvs.bipro.scripting.editor.BiproScriptRuntimeModule.configure(BiproScriptRuntimeModule.java:22)
1 error
What can I do????
Regards
Goran
[Updated on: Thu, 12 April 2012 13:20] Report message to a moderator
|
|
|
|
|
Re: ScopeProvider in xtext 2.2.1 [message #1106660 is a reply to message #1106657] |
Wed, 11 September 2013 11:31 |
kamo cuvao Messages: 11 Registered: July 2013 |
Junior Member |
|
|
Try one of these overrides in MyDslRuntimeModule
//For the ScopeProvider
@Override
public Class<? extends IScopeProvider> bindIScopeProvider() {
// TODO Auto-generated method stub
return MyScopeProvider.class;
}
//For the GlobalScopeProvider
@Override
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
// TODO Auto-generated method stub
return MyGlobalScopeProvider.class;
}
//For the ImportedNamespaceArareLocalScopeProvider
public void configureIScopeProviderDelegate(com.google.inject.Binder binder) {
binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class)
.annotatedWith(com.google.inject.name.Names.named(
org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE))
.to(MyDslImportedNamespaceAwareLocalScopeProvider.class);
}
I think the error is thrown, because you have created a new binding instead of overwriting an existing one, so you have two bindings on one class.
[Updated on: Wed, 11 September 2013 11:31] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03404 seconds