Hi,
Let's say we have this grammar
Model:
'package' name=FQN
imports+=Import*
entities+=Entity*;
Import:
'import' importedNamespace=FQNWithWildCards;
Entity:
'entity' name=ID '{' members+=Member * '};
Member:
'val' type=[Entity] name=ID;
And lets say we have these entities:
package somewhere.a1
entity A {}
package somewhere.else.a2
entity A {}
package my_test
import somewhere.a1.*
import somewhere.else.a2.*
entity MyTest {
val A a
}
here is the problem: I get an 'unresolved reference' on 'A'
-- this is by itself is fine by me, but the user can't really learn what went wrong here...
My solution is to validate every import, consult the indexer to come up with the list of entities this import adds, and check that no other import adds entities with the same local name.
I would like to know if there is a 'proper' xtext way doing this or perhaps if there are some classes i should reuse
Thanks in advance, yoel