Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Scope Provider: Context
Scope Provider: Context [message #763875] Sat, 10 December 2011 14:50 Go to next message
Eclipse UserFriend
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 15:25 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Sat, 10 December 2011 15:27] by Moderator

Re: Scope Provider: Context [message #763911 is a reply to message #763885] Sat, 10 December 2011 16:54 Go to previous message
Eclipse UserFriend
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 16:54] by Moderator

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


Current Time: Sat Jul 05 04:38:04 EDT 2025

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

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

Back to the top