Search in sources :

Example 1 with IResolvedField

use of org.eclipse.xtext.xbase.typesystem.override.IResolvedField in project xtext-xtend by eclipse.

the class AbstractXtendOutlineTreeBuilder method buildInheritedMembers.

protected void buildInheritedMembers(final JvmDeclaredType inferredType, final IXtendOutlineContext context) {
    ResourceSet _resourceSet = inferredType.eResource().getResourceSet();
    final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(this.services, _resourceSet);
    final LightweightTypeReference typeReference = owner.toLightweightTypeReference(inferredType);
    final List<LightweightTypeReference> superTypes = typeReference.getAllSuperTypes();
    IXtendOutlineContext superTypeContext = context;
    for (final LightweightTypeReference superTypeRef : superTypes) {
        {
            superTypeContext = superTypeContext.increaseInheritanceDepth();
            final ResolvedFeatures resolvedFeatures = new ResolvedFeatures(superTypeRef);
            List<IResolvedField> _declaredFields = resolvedFeatures.getDeclaredFields();
            for (final IResolvedField jvmField : _declaredFields) {
                boolean _skipFeature = this.skipFeature(jvmField.getDeclaration());
                boolean _not = (!_skipFeature);
                if (_not) {
                    this.xtendOutlineNodeBuilder.buildResolvedFeatureNode(inferredType, jvmField, superTypeContext);
                }
            }
            List<IResolvedConstructor> _declaredConstructors = resolvedFeatures.getDeclaredConstructors();
            for (final IResolvedConstructor constructor : _declaredConstructors) {
                boolean _skipFeature_1 = this.skipFeature(constructor.getDeclaration());
                boolean _not_1 = (!_skipFeature_1);
                if (_not_1) {
                    this.xtendOutlineNodeBuilder.buildResolvedFeatureNode(inferredType, constructor, superTypeContext);
                }
            }
            List<IResolvedOperation> _declaredOperations = resolvedFeatures.getDeclaredOperations();
            for (final IResolvedOperation operation : _declaredOperations) {
                if (((!this.skipFeature(operation.getDeclaration())) && (!superTypeContext.isProcessed(operation.getDeclaration())))) {
                    this.xtendOutlineNodeBuilder.buildResolvedFeatureNode(inferredType, operation, superTypeContext);
                }
            }
            final JvmType declaredType = superTypeRef.getType();
            if ((declaredType instanceof JvmDeclaredType)) {
                final IXtendOutlineContext nestedTypeContext = superTypeContext.hideInherited();
                final Consumer<JvmDeclaredType> _function = (JvmDeclaredType it) -> {
                    this.buildJvmType(it, nestedTypeContext);
                };
                Iterables.<JvmDeclaredType>filter(((JvmDeclaredType) declaredType).getMembers(), JvmDeclaredType.class).forEach(_function);
            }
        }
    }
}
Also used : LightweightTypeReference(org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference) ResolvedFeatures(org.eclipse.xtext.xbase.typesystem.override.ResolvedFeatures) IResolvedField(org.eclipse.xtext.xbase.typesystem.override.IResolvedField) JvmDeclaredType(org.eclipse.xtext.common.types.JvmDeclaredType) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) JvmType(org.eclipse.xtext.common.types.JvmType) IResolvedOperation(org.eclipse.xtext.xbase.typesystem.override.IResolvedOperation) IResolvedConstructor(org.eclipse.xtext.xbase.typesystem.override.IResolvedConstructor) Consumer(java.util.function.Consumer) IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext) EList(org.eclipse.emf.common.util.EList) List(java.util.List) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)

Aggregations

List (java.util.List)1 Consumer (java.util.function.Consumer)1 EList (org.eclipse.emf.common.util.EList)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 IXtendOutlineContext (org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)1 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)1 JvmType (org.eclipse.xtext.common.types.JvmType)1 IResolvedConstructor (org.eclipse.xtext.xbase.typesystem.override.IResolvedConstructor)1 IResolvedField (org.eclipse.xtext.xbase.typesystem.override.IResolvedField)1 IResolvedOperation (org.eclipse.xtext.xbase.typesystem.override.IResolvedOperation)1 ResolvedFeatures (org.eclipse.xtext.xbase.typesystem.override.ResolvedFeatures)1 LightweightTypeReference (org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference)1 StandardTypeReferenceOwner (org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)1