|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.scoping.impl.AbstractScopeProvider org.eclipse.xtext.xbase.scoping.XtypeScopeProvider org.eclipse.xtext.xbase.scoping.XbaseScopeProvider
public class XbaseScopeProvider
The scope provider for languages that use Xbase.
Nested Class Summary | |
---|---|
protected class |
XbaseScopeProvider.AbstractJvmFeatureScopeAcceptor
|
protected class |
XbaseScopeProvider.GenericTypeArgumentContextFactory
|
static interface |
XbaseScopeProvider.IJvmFeatureScopeAcceptor
|
protected class |
XbaseScopeProvider.JvmFeatureScopeAcceptor
|
protected class |
XbaseScopeProvider.SimpleAcceptor
|
Field Summary | |
---|---|
protected static int |
DEFAULT_IMPLICIT_STATIC_FEATURE_PRIORITY
|
protected static int |
DEFAULT_IT_PRIORITY
|
protected static int |
DEFAULT_MEMBER_CALL_PRIORITY
|
protected static int |
DEFAULT_STATIC_EXTENSION_PRIORITY_OFFSET
|
protected static int |
DEFAULT_SUGAR_PRIORITY_OFFSET
|
protected static int |
DEFAULT_THIS_PRIORITY
|
static QualifiedName |
IT
|
protected IJvmFeatureScopeProvider |
jvmFeatureScopeProvider
|
static QualifiedName |
SUPER
|
static QualifiedName |
THIS
|
Constructor Summary | |
---|---|
XbaseScopeProvider()
|
Method Summary | |
---|---|
protected boolean |
adaptsToJvmElement(org.eclipse.emf.ecore.EObject context)
|
protected void |
addFeatureCallScopes(org.eclipse.emf.ecore.EObject expression,
IScope localVariableScope,
QualifiedName variableName,
int priority,
XbaseScopeProvider.IJvmFeatureScopeAcceptor featureScopeDescriptions)
|
protected void |
addFeatureCallScopes(org.eclipse.emf.ecore.EObject featureCall,
IScope localVariableScope,
XbaseScopeProvider.IJvmFeatureScopeAcceptor featureScopeDescriptions)
|
protected void |
addFeatureDescriptionProviders(JvmDeclaredType contextType,
IFeaturesForTypeProvider featureProvider,
XExpression implicitReceiver,
XExpression implicitArgument,
int priority,
boolean preferStatics,
IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
|
protected void |
addFeatureDescriptionProviders(org.eclipse.emf.ecore.resource.Resource resource,
JvmDeclaredType contextType,
XExpression implicitReceiver,
XExpression implicitArgument,
int priority,
IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
|
protected void |
addFeatureDescriptionProvidersForAssignment(JvmDeclaredType contextType,
IFeaturesForTypeProvider featureProvider,
XExpression implicitReceiver,
XExpression implicitArgument,
int priority,
boolean preferStatics,
IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
|
protected void |
addFeatureDescriptionProvidersForAssignment(org.eclipse.emf.ecore.resource.Resource resource,
JvmDeclaredType contextType,
XExpression implicitReceiver,
XExpression implicitArgument,
int priority,
IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
|
protected void |
addFeatureScopes(JvmTypeReference receiverType,
org.eclipse.emf.ecore.EObject expression,
JvmDeclaredType contextType,
XExpression implicitReceiver,
XExpression implicitArgument,
int priority,
XbaseScopeProvider.IJvmFeatureScopeAcceptor acceptor)
|
protected void |
addStaticFeatureDescriptionProviders(org.eclipse.emf.ecore.resource.Resource resource,
JvmDeclaredType contextType,
IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
|
protected IScope |
createConstructorCallScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
|
protected IScope |
createFeatureCallScope(XAbstractFeatureCall call,
org.eclipse.emf.ecore.EReference reference)
creates the feature scope for XAbstractFeatureCall , including the local variables in case it is a feature
call without receiver (XFeatureCall). |
IScope |
createFeatureCallScopeForReceiver(XExpression context,
XExpression receiver,
org.eclipse.emf.ecore.EReference reference)
This method serves as an entry point for the content assist scoping for features. |
protected IScope |
createFeatureScopeForTypeRef(JvmTypeReference declaringType,
org.eclipse.emf.ecore.EObject expression,
XExpression implicitReceiver,
IScope parent)
|
protected IScope |
createImplicitFeatureCallScope(org.eclipse.emf.ecore.EObject call,
org.eclipse.emf.ecore.resource.Resource resource,
IScope parent,
IScope localVariableScope)
override to add any other implicit feature calls. |
protected IScope |
createLocalScopeForParameter(JvmFormalParameter p,
IScope parentScope)
|
protected IValidatedEObjectDescription |
createLocalVarDescription(JvmFormalParameter p)
|
protected IValidatedEObjectDescription |
createLocalVarDescription(XVariableDeclaration varDecl)
|
protected LocalVariableScopeContext |
createLocalVariableScopeContext(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
boolean includeCurrentBlock,
int idx)
|
protected IScope |
createLocalVarScope(IScope parentScope,
LocalVariableScopeContext scopeContext)
|
protected IScope |
createLocalVarScopeForBlock(XBlockExpression block,
int indexOfContextExpressionInBlock,
boolean referredFromClosure,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForCatchClause(XCatchClause catchClause,
int indexOfContextExpressionInBlock,
IScope parentScope)
Allows to hook into the local variable definition for catch clauses. |
protected IScope |
createLocalVarScopeForClosure(XClosure closure,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForJvmConstructor(JvmConstructor context,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForJvmDeclaredType(JvmDeclaredType type,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForJvmOperation(JvmOperation context,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForSwitchExpression(XSwitchExpression context,
IScope parentScope)
|
protected IScope |
createLocalVarScopeForTypeGuardedCase(XCasePart context,
IScope parentScope)
Allows to hook into the case guards to introduce new local variables with a specialized type. |
IScope |
createSimpleFeatureCallScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.resource.Resource resource,
boolean includeCurrentBlock,
int idx)
This method serves as an entry point for the content assist scoping for simple feature calls. |
protected IScope |
createTypeScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
|
protected IScope |
createTypeScope(JvmIdentifiableElement context,
org.eclipse.emf.ecore.EReference reference,
IScope parentScope)
|
protected JvmDeclaredType |
getContextType(org.eclipse.emf.ecore.EObject obj)
|
protected int |
getDefaultPriority()
|
protected FeatureCallToJavaMapping |
getFeatureCallToJavaMapping()
|
protected int |
getImplicitStaticExtensionPriorityOffset()
|
protected int |
getImplicitStaticFeaturePriority()
|
protected int |
getItPriority()
|
IScope |
getScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
Returns a scope for the given context. |
protected int |
getSugarPriorityOffset()
|
protected XExpression |
getSyntacticalReceiver(XAbstractFeatureCall call)
|
protected int |
getThisPriority()
|
protected ITypeProvider |
getTypeProvider()
|
protected boolean |
isConstructorCallScope(org.eclipse.emf.ecore.EReference reference)
|
boolean |
isFeatureCallScope(org.eclipse.emf.ecore.EReference reference)
|
protected boolean |
isTypeScope(org.eclipse.emf.ecore.EReference reference)
|
protected boolean |
isVisible(JvmFeature feature,
JvmDeclaredType contextType)
|
protected XConstructorProvider |
newConstructorProvider()
|
protected DefaultConstructorDescriptionProvider |
newDefaultConstructorDescriptionProvider()
|
protected DefaultJvmFeatureDescriptionProvider |
newDefaultFeatureDescriptionProvider()
|
protected StaticImplicitMethodsFeatureForTypeProvider |
newImplicitStaticFeaturesProvider()
|
protected XFeatureCallSugarDescriptionProvider |
newSugarDescriptionProvider()
|
void |
setDefaultFeatureDescProvider(com.google.inject.Provider<DefaultJvmFeatureDescriptionProvider> defaultFeatureDescProvider)
|
void |
setSugarFeatureDescProvider(com.google.inject.Provider<XFeatureCallSugarDescriptionProvider> sugarFeatureDescProvider)
|
void |
setTypeProvider(ITypeProvider typeProvider)
|
protected void |
sortDescriptionsFromLowestToHighest(java.util.List<IJvmFeatureScopeProvider.FeatureScopeDescription> list)
|
protected JvmTypeReference |
unkownToObject(JvmTypeReference receiverType,
org.eclipse.emf.ecore.EObject context)
|
Methods inherited from class org.eclipse.xtext.xbase.scoping.XtypeScopeProvider |
---|
delegateGetScope, getDelegate, getJvmTypeScope, setDelegate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_MEMBER_CALL_PRIORITY
protected static final int DEFAULT_IT_PRIORITY
protected static final int DEFAULT_THIS_PRIORITY
protected static final int DEFAULT_IMPLICIT_STATIC_FEATURE_PRIORITY
protected static final int DEFAULT_SUGAR_PRIORITY_OFFSET
protected static final int DEFAULT_STATIC_EXTENSION_PRIORITY_OFFSET
public static final QualifiedName THIS
public static final QualifiedName SUPER
public static final QualifiedName IT
@Inject protected IJvmFeatureScopeProvider jvmFeatureScopeProvider
Constructor Detail |
---|
public XbaseScopeProvider()
Method Detail |
---|
public void setTypeProvider(ITypeProvider typeProvider)
protected ITypeProvider getTypeProvider()
public void setSugarFeatureDescProvider(com.google.inject.Provider<XFeatureCallSugarDescriptionProvider> sugarFeatureDescProvider)
public void setDefaultFeatureDescProvider(com.google.inject.Provider<DefaultJvmFeatureDescriptionProvider> defaultFeatureDescProvider)
public IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
IScopeProvider
getScope
in interface IScopeProvider
getScope
in class XtypeScopeProvider
context
- the element from which an element shall be referenced. It doesn't need to be the element
containing the reference, it is just used to find the most inner scope for given EReference
.reference
- the reference for which to get the scope.
IScope
representing the inner most IScope
for the
passed context and reference. Note for implementors: The result may not be null
.
Return IScope.NULLSCOPE
instead.protected IScope createTypeScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
protected IScope createTypeScope(JvmIdentifiableElement context, org.eclipse.emf.ecore.EReference reference, IScope parentScope)
protected boolean isTypeScope(org.eclipse.emf.ecore.EReference reference)
protected boolean isVisible(JvmFeature feature, JvmDeclaredType contextType)
protected IScope createConstructorCallScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
protected boolean isConstructorCallScope(org.eclipse.emf.ecore.EReference reference)
public boolean isFeatureCallScope(org.eclipse.emf.ecore.EReference reference)
protected IScope createFeatureCallScope(XAbstractFeatureCall call, org.eclipse.emf.ecore.EReference reference)
XAbstractFeatureCall
, including the local variables in case it is a feature
call without receiver (XFeatureCall).
public IScope createSimpleFeatureCallScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.resource.Resource resource, boolean includeCurrentBlock, int idx)
context
- the context e.g. a for loop expression, a block or a catch clausereference
- the reference who's value shall be scoped. Not necessarily a feature of the context.includeCurrentBlock
- false
in the context of scoping but content assist will not have the
actual value holder of the reference at hand so it passes its container to this method and expects the
declared variables to be exposed in the scope.idx
- the index in an expression list of a block. Otherwise to be ignored.protected IScope createFeatureScopeForTypeRef(JvmTypeReference declaringType, org.eclipse.emf.ecore.EObject expression, XExpression implicitReceiver, IScope parent)
declaringType
- the type that declares the featureimplicitReceiver
- the instance that will receive the message.expression
- the expression that is closest to the to-be-created scope. Usually the feature call.protected LocalVariableScopeContext createLocalVariableScopeContext(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, boolean includeCurrentBlock, int idx)
public IScope createFeatureCallScopeForReceiver(XExpression context, XExpression receiver, org.eclipse.emf.ecore.EReference reference)
context
- 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.protected XExpression getSyntacticalReceiver(XAbstractFeatureCall call)
protected IScope createImplicitFeatureCallScope(org.eclipse.emf.ecore.EObject call, org.eclipse.emf.ecore.resource.Resource resource, IScope parent, IScope localVariableScope)
protected void addFeatureCallScopes(org.eclipse.emf.ecore.EObject featureCall, IScope localVariableScope, XbaseScopeProvider.IJvmFeatureScopeAcceptor featureScopeDescriptions)
protected void addFeatureCallScopes(org.eclipse.emf.ecore.EObject expression, IScope localVariableScope, QualifiedName variableName, int priority, XbaseScopeProvider.IJvmFeatureScopeAcceptor featureScopeDescriptions)
protected JvmTypeReference unkownToObject(JvmTypeReference receiverType, org.eclipse.emf.ecore.EObject context)
protected JvmDeclaredType getContextType(org.eclipse.emf.ecore.EObject obj)
protected IScope createLocalVarScope(IScope parentScope, LocalVariableScopeContext scopeContext)
protected IScope createLocalVarScopeForJvmOperation(JvmOperation context, IScope parentScope)
protected IScope createLocalVarScopeForJvmConstructor(JvmConstructor context, IScope parentScope)
protected IScope createLocalVarScopeForJvmDeclaredType(JvmDeclaredType type, IScope parentScope)
protected boolean adaptsToJvmElement(org.eclipse.emf.ecore.EObject context)
protected IScope createLocalVarScopeForSwitchExpression(XSwitchExpression context, IScope parentScope)
protected IScope createLocalVarScopeForTypeGuardedCase(XCasePart context, IScope parentScope)
context
- the case part.parentScope
- the parent scope.protected IScope createLocalVarScopeForCatchClause(XCatchClause catchClause, int indexOfContextExpressionInBlock, IScope parentScope)
catchClause
- the catch clause.indexOfContextExpressionInBlock
- the index of the context expression in its surrounding block.parentScope
- the parent scope.protected IScope createLocalVarScopeForBlock(XBlockExpression block, int indexOfContextExpressionInBlock, boolean referredFromClosure, IScope parentScope)
protected IScope createLocalVarScopeForClosure(XClosure closure, IScope parentScope)
protected void sortDescriptionsFromLowestToHighest(java.util.List<IJvmFeatureScopeProvider.FeatureScopeDescription> list)
protected void addFeatureScopes(JvmTypeReference receiverType, org.eclipse.emf.ecore.EObject expression, JvmDeclaredType contextType, XExpression implicitReceiver, XExpression implicitArgument, int priority, XbaseScopeProvider.IJvmFeatureScopeAcceptor acceptor)
protected void addStaticFeatureDescriptionProviders(org.eclipse.emf.ecore.resource.Resource resource, JvmDeclaredType contextType, IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
protected int getThisPriority()
protected int getDefaultPriority()
protected int getItPriority()
protected int getSugarPriorityOffset()
protected int getImplicitStaticExtensionPriorityOffset()
protected int getImplicitStaticFeaturePriority()
protected void addFeatureDescriptionProviders(JvmDeclaredType contextType, IFeaturesForTypeProvider featureProvider, XExpression implicitReceiver, XExpression implicitArgument, int priority, boolean preferStatics, IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
protected void addFeatureDescriptionProviders(org.eclipse.emf.ecore.resource.Resource resource, JvmDeclaredType contextType, XExpression implicitReceiver, XExpression implicitArgument, int priority, IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
protected StaticImplicitMethodsFeatureForTypeProvider newImplicitStaticFeaturesProvider()
protected void addFeatureDescriptionProvidersForAssignment(org.eclipse.emf.ecore.resource.Resource resource, JvmDeclaredType contextType, XExpression implicitReceiver, XExpression implicitArgument, int priority, IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
resource
- the resource which may define implicitly available feature description providers.protected void addFeatureDescriptionProvidersForAssignment(JvmDeclaredType contextType, IFeaturesForTypeProvider featureProvider, XExpression implicitReceiver, XExpression implicitArgument, int priority, boolean preferStatics, IAcceptor<IJvmFeatureDescriptionProvider> acceptor)
protected IScope createLocalScopeForParameter(JvmFormalParameter p, IScope parentScope)
protected IValidatedEObjectDescription createLocalVarDescription(JvmFormalParameter p)
protected IValidatedEObjectDescription createLocalVarDescription(XVariableDeclaration varDecl)
protected DefaultJvmFeatureDescriptionProvider newDefaultFeatureDescriptionProvider()
protected DefaultConstructorDescriptionProvider newDefaultConstructorDescriptionProvider()
protected XConstructorProvider newConstructorProvider()
protected XFeatureCallSugarDescriptionProvider newSugarDescriptionProvider()
protected FeatureCallToJavaMapping getFeatureCallToJavaMapping()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |