@Override protected void addDescription(QualifiedName name, JvmFeature feature, List<IEObjectDescription> result) { addToList(createDescription(name, feature, bucket), result); }
@Override public boolean isVisible(/* @NonNull */ JvmMember member) { return getSession().isVisible(member, receiverType, receiverFeature); }
protected IEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { if (implicit) { return new InstanceFeatureDescriptionWithImplicitReceiver(name, feature, receiver, receiverType, getReceiverTypeParameterMapping(), bucket.getFlags(), bucket.getId(), isVisible(feature), validStaticState); } else { return new InstanceFeatureDescription(name, feature, receiver, receiverType, getReceiverTypeParameterMapping(), bucket.getFlags(), bucket.getId(), isVisible(feature)); } }
@Override protected List<IEObjectDescription> getLocalElementsByName(QualifiedName name) { final Set<JvmFeature> allFeatures = Sets.newLinkedHashSet(); processFeatureNames(name, new NameAcceptor() { @Override public void accept(String simpleName, int order) { for(JvmFeature feature: allFeatures) { if (!feature.isStatic()) { addDescription(name, feature, allDescriptions);
/** * Creates a scope that returns the features of a given receiver type. * * @param featureCall the feature call that is currently processed by the scoping infrastructure * @param receiver an optionally available receiver expression * @param receiverType the type of the receiver. It may be available even if the receiver itself is null, which indicates an implicit receiver. * @param receiverFeature the feature that was linked as the receiver * @param implicitReceiver true if the receiver is an implicit receiver * @param validStatic true if the receiver is valid according the its static flag, e.g an implicit this in a static method is invalid * @param receiverBucket the types that contribute the static features. * @param parent the parent scope. Is never null. * @param session the currently known scope session. Is never null. */ protected IScope createReceiverFeatureScope( EObject featureCall, XExpression receiver, LightweightTypeReference receiverType, JvmIdentifiableElement receiverFeature, boolean implicitReceiver, boolean validStatic, TypeBucket receiverBucket, IScope parent, IFeatureScopeSession session) { return new ReceiverFeatureScope(parent, session, receiver, receiverType, implicitReceiver, asAbstractFeatureCall(featureCall), receiverBucket, receiverFeature, operatorMapping, validStatic); }
@Override public void accept(String simpleName, int order) { for(JvmType type: bucket.getTypes()) { if (type instanceof JvmDeclaredType) { List<JvmFeature> features = findAllFeaturesByName(type, simpleName, bucket.getResolvedFeaturesProvider()); if (order == 1) { allFeatures.addAll(features); } else { for(int i = 0, size = features.size(); i < size; i++) { JvmFeature feature = features.get(i); if (feature.eClass() == TypesPackage.Literals.JVM_OPERATION) { allFeatures.add(feature); } } } } } } });
@Override protected List<IEObjectDescription> getAllLocalElements() { Set<JvmFeature> allFeatures = Sets.newLinkedHashSet(); for(JvmType type: bucket.getTypes()) { if (type instanceof JvmDeclaredType) { IResolvedFeatures resolvedFeatures = bucket.getResolvedFeaturesProvider().getResolvedFeatures(type); allFeatures.addAll(resolvedFeatures.getAllFeatures()); } } if (allFeatures.isEmpty()) return Collections.emptyList(); List<IEObjectDescription> allDescriptions = Lists.newArrayListWithCapacity(allFeatures.size()); for(JvmFeature feature: allFeatures) { if (!feature.isStatic()) { addDescriptions(feature, allDescriptions); } } return allDescriptions; }