Class FeatureScopes

  • All Implemented Interfaces:
    IFeatureNames

    public class FeatureScopes
    extends java.lang.Object
    implements IFeatureNames
    Utility class when dealing with feature scopes or constructor scopes. Clients may want to override this one if they want to add a new implicit receiver.
    • Constructor Detail

      • FeatureScopes

        public FeatureScopes()
    • Method Detail

      • createFeatureCallScope

        public org.eclipse.xtext.scoping.IScope createFeatureCallScope​(org.eclipse.emf.ecore.EObject context,
                                                                       org.eclipse.emf.ecore.EReference reference,
                                                                       IFeatureScopeSession session,
                                                                       IResolvedTypes resolvedTypes)
        creates the feature scope for XAbstractFeatureCall, including the local variables in case it is a feature call without receiver (XFeatureCall).
        Parameters:
        session - the currently available session data
      • isFeatureCallScope

        public boolean isFeatureCallScope​(org.eclipse.emf.ecore.EReference reference)
      • createSimpleFeatureCallScope

        public org.eclipse.xtext.scoping.IScope createSimpleFeatureCallScope​(org.eclipse.emf.ecore.EObject context,
                                                                             IFeatureScopeSession session,
                                                                             IResolvedTypes resolvedTypes)
        This method serves as an entry point for the content assist scoping for simple feature calls.
        Parameters:
        context - the context e.g. a for loop expression, a block or a catch clause
      • createImplicitFeatureCallAndLocalVariableScope

        protected org.eclipse.xtext.scoping.IScope createImplicitFeatureCallAndLocalVariableScope​(org.eclipse.emf.ecore.EObject context,
                                                                                                  org.eclipse.xtext.scoping.IScope parent,
                                                                                                  IFeatureScopeSession session,
                                                                                                  IResolvedTypes resolvedTypes)
      • isDefiniteTypeLiteral

        protected boolean isDefiniteTypeLiteral​(XFeatureCall featureCall)
      • createConstructorDelegates

        protected org.eclipse.xtext.scoping.IScope createConstructorDelegates​(org.eclipse.emf.ecore.EObject context,
                                                                              org.eclipse.xtext.scoping.IScope parent,
                                                                              IFeatureScopeSession session,
                                                                              IResolvedTypes resolvedTypes)
      • asAbstractFeatureCall

        protected XAbstractFeatureCall asAbstractFeatureCall​(org.eclipse.emf.ecore.EObject context)
      • createFeatureScopeForTypeRef

        protected org.eclipse.xtext.scoping.IScope createFeatureScopeForTypeRef​(XExpression receiver,
                                                                                LightweightTypeReference featureDeclarator,
                                                                                boolean implicit,
                                                                                org.eclipse.emf.ecore.EObject featureCall,
                                                                                IFeatureScopeSession session,
                                                                                org.eclipse.xtext.common.types.JvmIdentifiableElement receiverFeature,
                                                                                org.eclipse.xtext.scoping.IScope parent,
                                                                                boolean validStaticScope)
      • createFeatureCallScopeForReceiver

        public org.eclipse.xtext.scoping.IScope createFeatureCallScopeForReceiver​(XExpression featureCall,
                                                                                  XExpression receiver,
                                                                                  IFeatureScopeSession session,
                                                                                  IResolvedTypes resolvedTypes)
        This method serves as an entry point for the content assist scoping for features.
        Parameters:
        featureCall - the context provides access to the resource set. If it is an assignment, it will be used to restrict scoping.
        receiver - the receiver of the feature call.
        resolvedTypes - TODO
        session - TODO
      • isValidFeatureCallArgument

        protected boolean isValidFeatureCallArgument​(XExpression expression,
                                                     org.eclipse.xtext.common.types.JvmIdentifiableElement linkedReceiver,
                                                     IFeatureScopeSession session)
        Returns true if the linked receiver may be passed as an argument. Basically everything could be passed as an argument except the linked receiver is null, a proxy or a reference to super.
      • createDynamicExtensionsScope

        protected org.eclipse.xtext.scoping.IScope createDynamicExtensionsScope​(org.eclipse.xtext.naming.QualifiedName implicitFirstArgumentName,
                                                                                org.eclipse.emf.ecore.EObject featureCall,
                                                                                IFeatureScopeSession captureLayer,
                                                                                IFeatureScopeSession session,
                                                                                IResolvedTypes resolvedTypes,
                                                                                org.eclipse.xtext.scoping.IScope parent,
                                                                                boolean all)
      • getDeepLocalElement

        protected org.eclipse.xtext.resource.IEObjectDescription getDeepLocalElement​(IFeatureScopeSession session,
                                                                                     org.eclipse.xtext.naming.QualifiedName name)
      • getDeepLocalElements

        protected java.util.List<org.eclipse.xtext.resource.IEObjectDescription> getDeepLocalElements​(IFeatureScopeSession session,
                                                                                                      org.eclipse.xtext.naming.QualifiedName name)
      • createDynamicExtensionsScope

        protected org.eclipse.xtext.scoping.IScope createDynamicExtensionsScope​(org.eclipse.xtext.naming.QualifiedName implicitFirstArgumentName,
                                                                                org.eclipse.xtext.resource.IEObjectDescription firstArgumentDescription,
                                                                                org.eclipse.emf.ecore.EObject featureCall,
                                                                                IFeatureScopeSession captureLayer,
                                                                                IFeatureScopeSession session,
                                                                                IResolvedTypes resolvedTypes,
                                                                                org.eclipse.xtext.scoping.IScope parent)
      • createImplicitFeatureCallScope

        protected org.eclipse.xtext.scoping.IScope createImplicitFeatureCallScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                                  org.eclipse.xtext.scoping.IScope parent,
                                                                                  IFeatureScopeSession session,
                                                                                  IResolvedTypes resolvedTypes)
      • createImplicitFeatureCallScope

        protected org.eclipse.xtext.scoping.IScope createImplicitFeatureCallScope​(org.eclipse.xtext.naming.QualifiedName implicitName,
                                                                                  org.eclipse.emf.ecore.EObject featureCall,
                                                                                  IFeatureScopeSession session,
                                                                                  IResolvedTypes resolvedTypes,
                                                                                  org.eclipse.xtext.scoping.IScope parent)
      • createImplicitExtensionScope

        protected org.eclipse.xtext.scoping.IScope createImplicitExtensionScope​(org.eclipse.xtext.naming.QualifiedName implicitName,
                                                                                org.eclipse.emf.ecore.EObject featureCall,
                                                                                IFeatureScopeSession session,
                                                                                IResolvedTypes resolvedTypes,
                                                                                org.eclipse.xtext.scoping.IScope parent)
      • createImplicitStaticScope

        protected org.eclipse.xtext.scoping.IScope createImplicitStaticScope​(org.eclipse.xtext.naming.QualifiedName implicitName,
                                                                             XAbstractFeatureCall featureCall,
                                                                             IFeatureScopeSession session,
                                                                             IResolvedTypes resolvedTypes,
                                                                             org.eclipse.xtext.scoping.IScope parent)
      • createStaticFeatureScope

        protected org.eclipse.xtext.scoping.IScope createStaticFeatureScope​(XAbstractFeatureCall featureCall,
                                                                            XExpression receiver,
                                                                            LightweightTypeReference receiverType,
                                                                            TypeBucket receiverBucket,
                                                                            org.eclipse.xtext.scoping.IScope parent,
                                                                            IFeatureScopeSession session)
        Create a scope that contains static features. The features may be obtained implicitly from a given type (receiver is null), or the features may be obtained from a concrete instance.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        receiver - an optionally available receiver expression
        receiverType - the type of the receiver. It may be available even if the receiver itself is null, which indicates an implicit receiver.
        receiverBucket - the types that contribute the static features.
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createStaticFeatureOnTypeLiteralScope

        protected org.eclipse.xtext.scoping.IScope createStaticFeatureOnTypeLiteralScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                                         XExpression receiver,
                                                                                         LightweightTypeReference receiverType,
                                                                                         TypeBucket receiverBucket,
                                                                                         org.eclipse.xtext.scoping.IScope parent,
                                                                                         IFeatureScopeSession session)
        Creates a scope for the static features that are exposed by a type that was used, e.g. java.lang.String.valueOf(1) where valueOf(1) is to be linked.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        receiver - an optionally available receiver expression
        receiverType - the type of the receiver. It may be available even if the receiver itself is null, which indicates an implicit receiver.
        receiverBucket - the types that contribute the static features.
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createDynamicExtensionsScope

        protected org.eclipse.xtext.scoping.IScope createDynamicExtensionsScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                                XExpression firstArgument,
                                                                                LightweightTypeReference firstArgumentType,
                                                                                boolean implicitArgument,
                                                                                org.eclipse.xtext.scoping.IScope parent,
                                                                                IFeatureScopeSession session)
        Create a scope that contains dynamic extension features, which are features that are contributed by an instance of a type.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        firstArgument - an optionally available first argument expression.
        firstArgumentType - optionally the type of the first argument
        implicitArgument - if the argument is an implicit argument or explicitly given (in concrete syntax)
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createStaticExtensionsScope

        protected org.eclipse.xtext.scoping.IScope createStaticExtensionsScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                               XExpression firstArgument,
                                                                               LightweightTypeReference firstArgumentType,
                                                                               boolean implicitArgument,
                                                                               org.eclipse.xtext.scoping.IScope parent,
                                                                               IFeatureScopeSession session)
        Create a scope that contains static extension features, which are features that are contributed statically via an import.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        firstArgument - an optionally available first argument expression.
        firstArgumentType - optionally the type of the first argument
        implicitArgument - if the argument is an implicit argument or explicitly given (in concrete syntax)
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createTypeLiteralScope

        protected org.eclipse.xtext.scoping.IScope createTypeLiteralScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                          org.eclipse.xtext.naming.QualifiedName parentSegments,
                                                                          org.eclipse.xtext.scoping.IScope parent,
                                                                          IFeatureScopeSession session,
                                                                          IResolvedTypes resolvedTypes)
        Create a scope that returns types, e.g. for member feature calls that are actually type references like java.lang.String.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        parentSegments - the segments of the fully qualified type name that are already known. The queried element name will be appended to them.
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createNestedTypeLiteralScope

        protected org.eclipse.xtext.scoping.IScope createNestedTypeLiteralScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                                LightweightTypeReference enclosingType,
                                                                                org.eclipse.xtext.common.types.JvmDeclaredType rawEnclosingType,
                                                                                org.eclipse.xtext.scoping.IScope parent,
                                                                                IFeatureScopeSession session)
        Create a scope that returns nested types.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        enclosingType - the enclosing type including type parameters for the nested type literal scope.
        rawEnclosingType - the raw type that is used to query the nested types.
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createStaticFeaturesScope

        protected org.eclipse.xtext.scoping.IScope createStaticFeaturesScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                             org.eclipse.xtext.scoping.IScope parent,
                                                                             IFeatureScopeSession session)
        Creates a scope for the statically imported features.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createLocalVariableScope

        protected org.eclipse.xtext.scoping.IScope createLocalVariableScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                            org.eclipse.xtext.scoping.IScope parent,
                                                                            IFeatureScopeSession session,
                                                                            IResolvedTypes resolvedTypes)
        Creates a scope for the local variables that have been registered in the given session.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
        resolvedTypes - may be used by inheritors.
      • createConstructorDelegateScope

        protected org.eclipse.xtext.scoping.IScope createConstructorDelegateScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                                  LightweightTypeReference type,
                                                                                  org.eclipse.xtext.scoping.IScope parent,
                                                                                  IFeatureScopeSession session)
        A constructor delegate scope provides the descriptions for this() and super() calls in a constructor body.
      • createCompositeScope

        protected CompositeScope createCompositeScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                      org.eclipse.xtext.scoping.IScope parent,
                                                      IFeatureScopeSession session)
        Create a composite scope that returns description from multiple other scopes without applying shadowing semantics to then.
      • createReceiverFeatureScope

        protected org.eclipse.xtext.scoping.IScope createReceiverFeatureScope​(org.eclipse.emf.ecore.EObject featureCall,
                                                                              XExpression receiver,
                                                                              LightweightTypeReference receiverType,
                                                                              org.eclipse.xtext.common.types.JvmIdentifiableElement receiverFeature,
                                                                              boolean implicitReceiver,
                                                                              boolean validStatic,
                                                                              TypeBucket receiverBucket,
                                                                              org.eclipse.xtext.scoping.IScope parent,
                                                                              IFeatureScopeSession session)
        Creates a scope that returns the features of a given receiver type.
        Parameters:
        featureCall - the feature call that is currently processed by the scoping infrastructure
        receiver - an optionally available receiver expression
        receiverType - the type of the receiver. It may be available even if the receiver itself is null, which indicates an implicit receiver.
        receiverFeature - the feature that was linked as the receiver
        implicitReceiver - true if the receiver is an implicit receiver
        validStatic - true if the receiver is valid according the its static flag, e.g an implicit this in a static method is invalid
        receiverBucket - the types that contribute the static features.
        parent - the parent scope. Is never null.
        session - the currently known scope session. Is never null.
      • createFollowUpErrorScope

        protected org.eclipse.xtext.scoping.IScope createFollowUpErrorScope​(LightweightTypeReference receiverType)
      • getXbaseFactory

        protected XbaseFactory getXbaseFactory()