[Xtext]Cross reference between different files [message #665716] |
Fri, 15 April 2011 11:15  |
Eclipse User |
|
|
|
Hi,
I made my grammar with Xtext and it contains cross-references between elements.
At this time, if an element is define in a file, I can refer it in a different file.
I want to restrict cross-referencing to only element present in the same file.
I hope I was clear.
How can I do that ?
|
|
|
|
|
|
|
Re: [Xtext]Cross reference between different files [message #1508516 is a reply to message #1508384] |
Fri, 12 December 2014 08:34   |
Eclipse User |
|
|
|
Hi christian
Actually I think I have framed my question non-clearly. For example, I have 3 model files(A,B,C) of the same grammar. In the 1st File A I have a cross-reference. Now content assist provides me with all the suitable candidates from the other 2 files also, irrespective of my specific import statement ( importedNamespace way not importURI ) in A which points to File B, only. Firstly, What I want is, to restrict the content assist in File A to show options from itself and File B and not from file C, as it is not required in the context of file A. Secondly, if the user wants to point to a particular attribute in File C without importing it, he can do that using FullyQualifiedNaming convention like we do in JAVA, directly. So, my concern is not with the second point , as it is working properly, but with the first.
Do you think I should be customizing the ContentAssistProvider or the ScopeProvider to restrict exposure? Hope I am able to explain my requirement.
By the way what did you mean by "you want to import simple names as well" ? Sorry I did not get you.
Regards
Puneet
|
|
|
Re: [Xtext]Cross reference between different files [message #1508526 is a reply to message #1508516] |
Fri, 12 December 2014 08:42  |
Eclipse User |
|
|
|
i still dont get your question
so you want to write
import SomeElement
....
use SomeElement
instead of simply using
right?
you have to adapt ImportedNamespaceAwareLocalScopeProvider. have a look what ImportScope does.
[Updated on: Fri, 12 December 2014 08:44] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04946 seconds