Search in sources :

Example 1 with LocalTypeSubstitutor

use of org.eclipse.xtext.xbase.typesystem.util.LocalTypeSubstitutor in project xtext-xtend by eclipse.

the class CreateMemberQuickfixes method getResolvedArgumentTypes.

protected List<LightweightTypeReference> getResolvedArgumentTypes(EObject context, JvmIdentifiableElement logicalContainer, List<XExpression> arguments) {
    List<LightweightTypeReference> argumentTypes = newArrayList();
    IResolvedTypes resolvedTypes = typeResolver.resolveTypes(context);
    for (XExpression argument : arguments) {
        LightweightTypeReference resolved = resolvedTypes.getActualType(argument);
        if (resolved == null) {
            StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, context);
            argumentTypes.add(owner.newReferenceToObject());
        } else {
            LocalTypeSubstitutor substitutor = new LocalTypeSubstitutor(resolved.getOwner(), logicalContainer);
            argumentTypes.add(substitutor.withoutLocalTypes(resolved));
        }
    }
    return argumentTypes;
}
Also used : LightweightTypeReference(org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference) IResolvedTypes(org.eclipse.xtext.xbase.typesystem.IResolvedTypes) XExpression(org.eclipse.xtext.xbase.XExpression) LocalTypeSubstitutor(org.eclipse.xtext.xbase.typesystem.util.LocalTypeSubstitutor) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)

Aggregations

XExpression (org.eclipse.xtext.xbase.XExpression)1 IResolvedTypes (org.eclipse.xtext.xbase.typesystem.IResolvedTypes)1 LightweightTypeReference (org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference)1 StandardTypeReferenceOwner (org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)1 LocalTypeSubstitutor (org.eclipse.xtext.xbase.typesystem.util.LocalTypeSubstitutor)1