Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Scope Provider: Context
Scope Provider: Context [message #763875] Sat, 10 December 2011 19:50 Go to next message
thomas.kipar is currently offline thomas.kiparFriend
Messages: 13
Registered: July 2011
Junior Member
Hi,

I am currently implementing my own scope provider. To create my scope, I need to know the "context" around it. Lets say my DSL looks something like that:

namespace A {
   // invoke scope provider here for some cross reference, e.g. for auto-completion
}


The scope provider gets the context (the Xtext resouce) and the EReference as input. What I need additionally is the name of the outer namespace, in this case "A" in order to provide my scope. As far as I know, I cannot get this information out of the two parameters (please correct me if I am wrong).

What do I have to do, to get the "A" when invoking the scope-provider withing the namespace?

Regards,

Thomas
Re: Scope Provider: Context [message #763885 is a reply to message #763875] Sat, 10 December 2011 20:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i do not understand your question. here is the IScopeProvider interface

public interface IScopeProvider {

	IScope getScope(EObject context, EReference reference);

}


it has everything you need. you can walk up the context and its econtainers to find out where you are.

so could you elaborate what you exactly want to do what
is not given by the default implementation and its hooks for customization?

never the less resource.getContents().get(0) gives you the model root.

~Christian


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

[Updated on: Sat, 10 December 2011 20:27]

Report message to a moderator

Re: Scope Provider: Context [message #763911 is a reply to message #763885] Sat, 10 December 2011 21:54 Go to previous message
thomas.kipar is currently offline thomas.kiparFriend
Messages: 13
Registered: July 2011
Junior Member
Hello,

I was somehow focused on the IGlobalScopeProvider... Everything is fine with the "normal" IScopeProvider. Gives me exactly what I want.

Thanks a lot!

[Updated on: Sat, 10 December 2011 21:54]

Report message to a moderator

Previous Topic:Codegeneration next to DSL
Next Topic:problem combining importURI and importNamespace
Goto Forum:
  


Current Time: Thu Apr 25 19:41:04 GMT 2024

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

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

Back to the top