I am using Xtext 2.10.0 and seem to have some issues with cross-references. Simplified, my grammar (with org.eclipse.xtext.common.Terminals) is the following:
Model:
package=Package
dtos+=DTO*;
Package:
'package' name=FQN;
FQN:
ID ('.' ID)*;
DTO:
'dto' name=ID ('extends' extendedDTO=[DTO|FQN])? '{' '}';
In order to provide a correct qualified name for the DTOs, I implemented an own DefaultDeclarativeQualifiedNameProvider, which assembles a qualified name based on the name of the package and the name of the DTO.
Now I create a first DTO in a file "base.dto":
package base
dto BaseDTO {}
In a second file "mydto.dto" I create a second DTO:
package mydto
dto MyDTO extends base.BaseDTO {}
The part "base.BaseDTO" is even suggested by the autocompletion mechanism. However, Eclipse marks this part as an error and says "Couldn't resolve reference to DTO 'base.BaseDTO'.". What do I have to change in order to resolve this reference?
Here i my NameProvider Impl