Customization Points

There are several customization hooks in the runtime layer and on the editor side as well:

The AbstractTypeScopeProvider can be used to create scopes for members with respect to the override semantics of the Java language. Of course it is possible to use this implementation to create scopes for types as well.

As the Java VM types expose a lot of information about visibility, parameter- and return types, generic, available annotations or enumeration literals, it is very easy to define constraints for the referred types.

The ITypesProposalProvider can be used to provide optimized proposals based on various filter criteria. The most common selector can be used directly via createSubTypeProposals. The implementation is optimized and uses the JDT Index directly to minimize the effort for object instantiation. The class TypeMatchFilters provides a comprehensive set of reusable filters that can be easily combined to reduce the list of proposals to a smaller number of valid entries.

import static org.eclipse.xtext.common.types.xtext.ui.TypeMatchFilters.*; 
..
..

  proposalProvider.createSubTypeProposals(factory, context,
      and(not(canInstantiate()), isPublic()), acceptor);