In the DomainModel example shipped with Xtext 2.2 I want to have model elements of type Entity defined in the current model and imported from external models be visible in the completion list of references to model elements of type JvmTypeReference like Property.type in the DomainModel example alongside Jvm types defined in the classpath.
Generally referencing Entity works. In other words, it's in Scope of Property.type.
But it's missing in the completion list of Property.type.
Is there a simple way to implement this?
If I would override completeJvmParameterizedTypeReference_Type() method of the DomainmodelProposalProvider, how can I access all visible elements of Type Entity?
@Override
public void completeJvmParameterizedTypeReference_Type(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor)
{
super.completeJvmParameterizedTypeReference_Type(model, assignment, context, acceptor);
for (Entity entity: all visible elements of type Entity)
acceptor.accept(createCompletionProposal(qualifiedNameProvider.getFullyQualifiedName(entity).toString(), context));
}