Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » DeclarativeScopeProvider as delegate(How to integrate my own DeclarativeScopeProvider into the generated stub)
DeclarativeScopeProvider as delegate [message #1837072] Thu, 21 January 2021 15:26 Go to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
I have implemented my own ScopeProvider for my grammar.
But somehow I am not able to integrate it streamlining with the stubs generated be Xtext

The stub is GeneratorModelScopeProvider(package omitted)
it is an AbstractGeneratorModelScopeProvider which in turn is an
DelegatingScopeProvider.

During debugging I recognized that the ScopeProvider is instantiated over and over again. Which surprise me. because I thought this instance could be reused for the whole runtime.

I suffered some NullPointerExeptions because one delegate in the generated stub does not get set as it should be.

I guess I only need to Guice annotate my ScopeProvider in the right way and the problem is solved.


Re: DeclarativeScopeProvider as delegate [message #1837073 is a reply to message #1837072] Thu, 21 January 2021 15:28 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
which delegate do you mean and what are you doing

the normal delegating scopeprovider is bound by
public void configureIScopeProviderDelegate(Binder binder) {
binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class);
}

in AbstractMyDslRuntimeModule


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 21 January 2021 15:29]

Report message to a moderator

Previous Topic:Import MyDslStandaloneSetup does not resolve
Next Topic:Import of Xtext Grammar Model
Goto Forum:
  


Current Time: Sat Apr 20 03:13:45 GMT 2024

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

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

Back to the top