org.eclipse.xtext.xbase.ui.contentassist
Class XbaseProposalProvider
java.lang.Object
org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider
org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider
org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider
org.eclipse.xtext.xbase.ui.contentassist.AbstractXtypeProposalProvider
org.eclipse.xtext.xbase.ui.contentassist.XtypeProposalProvider
org.eclipse.xtext.xbase.ui.contentassist.AbstractXbaseProposalProvider
org.eclipse.xtext.xbase.ui.contentassist.XbaseProposalProvider
- All Implemented Interfaces:
- ICompletionProposalFactory, IContentProposalProvider, RepeatedContentAssistProcessor.ModeAware
- Direct Known Subclasses:
- AbstractPureXbaseProposalProvider, AbstractXbaseWithAnnotationsProposalProvider
public class XbaseProposalProvider
- extends AbstractXbaseProposalProvider
- implements RepeatedContentAssistProcessor.ModeAware
see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on how to customize content assistant
Method Summary |
protected void |
appendParameters(org.eclipse.jface.viewers.StyledString result,
JvmExecutable executable,
int insignificantParameters)
|
protected void |
completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
boolean forced,
IValueConverter<java.lang.String> valueConverter,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
|
protected void |
completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
ICompletionProposalAcceptor acceptor)
|
protected void |
completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
|
protected void |
completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
IValueConverter<java.lang.String> valueConverter,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
|
void |
completeJvmParameterizedTypeReference_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeKeyword(Keyword keyword,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
|
void |
completeXAssignment_Feature(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXBlockExpression_Expressions(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXCasePart_Case(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXCasePart_Then(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXFeatureCall_DeclaringType(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXFeatureCall_Feature(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXRelationalExpression_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
completeXTypeLiteral_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
protected void |
createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
boolean includeCurrentObject,
int idx,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
|
protected void |
createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
Create proposal for simple feature calls that use an IdOrSuper
as concrete syntax. |
protected void |
createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
int idx,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
|
protected void |
createReceiverProposals(XExpression receiver,
CrossReference crossReference,
org.eclipse.emf.ecore.EReference reference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor,
com.google.common.base.Predicate<IEObjectDescription> filter)
|
protected boolean |
doCreateIdProposals()
|
protected boolean |
doCreateIntProposals()
|
protected boolean |
doCreateStringProposals()
|
protected boolean |
doNotProposeFeatureOfBinaryOperation(ContentAssistContext contentAssistContext,
XBinaryOperation binaryOperation)
|
protected java.lang.String |
getFeatureCallRuleName()
|
protected com.google.common.base.Predicate<IEObjectDescription> |
getFeatureDescriptionPredicate(ContentAssistContext contentAssistContext)
|
java.lang.String |
getNextCategory()
|
protected com.google.common.base.Function<IEObjectDescription,org.eclipse.jface.text.contentassist.ICompletionProposal> |
getProposalFactory(java.lang.String ruleName,
ContentAssistContext contentAssistContext)
|
protected QualifiedNameValueConverter |
getQualifiedNameValueConverter()
|
XbaseScopeProvider |
getScopeProvider()
|
protected org.eclipse.jface.viewers.StyledString |
getStyledDisplayString(JvmFeature feature,
boolean withParenths,
int insignificantParameters,
java.lang.String qualifiedNameAsString,
java.lang.String shortName)
|
protected Assignment |
getXAssignmentFeatureAssignment()
|
XbaseReferenceProposalCreator |
getXbaseCrossReferenceProposalCreator()
|
protected Keyword |
getXForLoopRightParenthesis()
|
protected boolean |
isIdRule(java.lang.String ruleName)
|
protected boolean |
isKeywordWorthyToPropose(Keyword keyword)
|
boolean |
isLastMode()
|
protected boolean |
isParentOf(INode node,
INode child)
|
protected void |
lookupCrossReference(CrossReference crossReference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
|
protected void |
lookupCrossReference(CrossReference crossReference,
org.eclipse.emf.ecore.EReference reference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor,
com.google.common.base.Predicate<IEObjectDescription> filter)
Customized to be able to treat binary operations in a special way with respect to scoping. |
void |
nextMode()
Announce that proposals will be computed. |
void |
proposeDeclaringTypeForStaticInvocation(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
|
void |
reset()
Reset the proposal provider's repetition state. |
Methods inherited from class org.eclipse.xtext.xbase.ui.contentassist.AbstractXbaseProposalProvider |
complete_FullJvmFormalParameter, complete_IdOrSuper, complete_JvmFormalParameter, complete_OpAdd, complete_OpAnd, complete_OpCompare, complete_OpEquality, complete_OpMulti, complete_OpMultiAssign, complete_OpOr, complete_OpOther, complete_OpSingleAssign, complete_OpUnary, complete_QualifiedName, complete_StaticQualifier, complete_XAdditiveExpression, complete_XAndExpression, complete_XAssignment, complete_XBlockExpression, complete_XBooleanLiteral, complete_XCasePart, complete_XCastedExpression, complete_XCatchClause, complete_XClosure, complete_XConstructorCall, complete_XDoWhileExpression, complete_XEqualityExpression, complete_XExpression, complete_XExpressionInClosure, complete_XExpressionInsideBlock, complete_XFeatureCall, complete_XForLoopExpression, complete_XIfExpression, complete_XIntLiteral, complete_XLiteral, complete_XMemberFeatureCall, complete_XMultiplicativeExpression, complete_XNullLiteral, complete_XOrExpression, complete_XOtherOperatorExpression, complete_XParenthesizedExpression, complete_XPrimaryExpression, complete_XRelationalExpression, complete_XReturnExpression, complete_XShortClosure, complete_XStringLiteral, complete_XSwitchExpression, complete_XThrowExpression, complete_XTryCatchFinallyExpression, complete_XTypeLiteral, complete_XUnaryOperation, complete_XVariableDeclaration, complete_XWhileExpression, completeFullJvmFormalParameter_Name, completeFullJvmFormalParameter_ParameterType, completeJvmFormalParameter_Name, completeJvmFormalParameter_ParameterType, completeXAdditiveExpression_Feature, completeXAdditiveExpression_RightOperand, completeXAndExpression_Feature, completeXAndExpression_RightOperand, completeXAssignment_RightOperand, completeXAssignment_Value, completeXBooleanLiteral_IsTrue, completeXCasePart_TypeGuard, completeXCastedExpression_Type, completeXCatchClause_DeclaredParam, completeXCatchClause_Expression, completeXClosure_DeclaredFormalParameters, completeXClosure_ExplicitSyntax, completeXClosure_Expression, completeXConstructorCall_Arguments, completeXConstructorCall_Constructor, completeXConstructorCall_TypeArguments, completeXDoWhileExpression_Body, completeXDoWhileExpression_Predicate, completeXEqualityExpression_Feature, completeXEqualityExpression_RightOperand, completeXExpressionInClosure_Expressions, completeXFeatureCall_ExplicitOperationCall, completeXFeatureCall_FeatureCallArguments, completeXFeatureCall_TypeArguments, completeXForLoopExpression_DeclaredParam, completeXForLoopExpression_EachExpression, completeXForLoopExpression_ForExpression, completeXIfExpression_Else, completeXIfExpression_If, completeXIfExpression_Then, completeXIntLiteral_Value, completeXMemberFeatureCall_ExplicitOperationCall, completeXMemberFeatureCall_Feature, completeXMemberFeatureCall_MemberCallArguments, completeXMemberFeatureCall_NullSafe, completeXMemberFeatureCall_Spreading, completeXMemberFeatureCall_TypeArguments, completeXMemberFeatureCall_Value, completeXMultiplicativeExpression_Feature, completeXMultiplicativeExpression_RightOperand, completeXOrExpression_Feature, completeXOrExpression_RightOperand, completeXOtherOperatorExpression_Feature, completeXOtherOperatorExpression_RightOperand, completeXRelationalExpression_Feature, completeXRelationalExpression_RightOperand, completeXReturnExpression_Expression, completeXShortClosure_DeclaredFormalParameters, completeXShortClosure_ExplicitSyntax, completeXShortClosure_Expression, completeXStringLiteral_Value, completeXSwitchExpression_Cases, completeXSwitchExpression_Default, completeXSwitchExpression_LocalVarName, completeXSwitchExpression_Switch, completeXThrowExpression_Expression, completeXTryCatchFinallyExpression_CatchClauses, completeXTryCatchFinallyExpression_Expression, completeXTryCatchFinallyExpression_FinallyExpression, completeXUnaryOperation_Feature, completeXUnaryOperation_Operand, completeXVariableDeclaration_Name, completeXVariableDeclaration_Right, completeXVariableDeclaration_Type, completeXVariableDeclaration_Writeable, completeXWhileExpression_Body, completeXWhileExpression_Predicate |
Methods inherited from class org.eclipse.xtext.xbase.ui.contentassist.AbstractXtypeProposalProvider |
complete_ID, complete_JvmArgumentTypeReference, complete_JvmLowerBound, complete_JvmParameterizedTypeReference, complete_JvmTypeParameter, complete_JvmTypeReference, complete_JvmUpperBound, complete_JvmUpperBoundAnded, complete_JvmWildcardTypeReference, complete_ValidID, complete_XFunctionTypeRef, completeJvmLowerBound_TypeReference, completeJvmParameterizedTypeReference_Arguments, completeJvmTypeParameter_Constraints, completeJvmTypeParameter_Name, completeJvmUpperBound_TypeReference, completeJvmUpperBoundAnded_TypeReference, completeJvmWildcardTypeReference_Constraints, completeXFunctionTypeRef_ParamTypes, completeXFunctionTypeRef_ReturnType |
Methods inherited from class org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider |
completeAssignment, completeRuleCall, createProposals, getCrossReferenceProposalCreator, getHover, invokeMethod, lookupCrossReference, lookupCrossReference, lookupCrossReference, lookupCrossReference, setCrossReferenceProposalCreator, setScopeProvider |
Methods inherited from class org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider |
createCompletionProposal, createCompletionProposal, createCompletionProposal, createCompletionProposal, createSelector, doCreateProposal, doCreateProposal, getConflictHelper, getDisplayString, getImage, getKeywordDisplayString, getLabelProvider, getPriorityHelper, getQualifiedNameConverter, getStyledDisplayString, getStyledDisplayString, getValueConverter, isValidProposal, setConflictHelper, setLabelProvider, setPriorityHelper, setValueConverter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XbaseProposalProvider
public XbaseProposalProvider()
getNextCategory
public java.lang.String getNextCategory()
- Specified by:
getNextCategory
in interface RepeatedContentAssistProcessor.ModeAware
- Returns:
- a description of the proposal category that will be
retrieved after a subsequent invocation of
RepeatedContentAssistProcessor.ModeAware.nextMode()
.
nextMode
public void nextMode()
- Description copied from interface:
RepeatedContentAssistProcessor.ModeAware
- Announce that proposals will be computed.
- Specified by:
nextMode
in interface RepeatedContentAssistProcessor.ModeAware
reset
public void reset()
- Description copied from interface:
RepeatedContentAssistProcessor.ModeAware
- Reset the proposal provider's repetition state. The intial
proposals should be displayed after a subsequent
call to
RepeatedContentAssistProcessor.ModeAware.nextMode()
.
- Specified by:
reset
in interface RepeatedContentAssistProcessor.ModeAware
isLastMode
public boolean isLastMode()
- Specified by:
isLastMode
in interface RepeatedContentAssistProcessor.ModeAware
- Returns:
true
if a subsequent call to RepeatedContentAssistProcessor.ModeAware.nextMode()
will
show the proposals for the first mode.
getXbaseCrossReferenceProposalCreator
public XbaseReferenceProposalCreator getXbaseCrossReferenceProposalCreator()
completeJvmParameterizedTypeReference_Type
public void completeJvmParameterizedTypeReference_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeJvmParameterizedTypeReference_Type
in class AbstractXtypeProposalProvider
completeXRelationalExpression_Type
public void completeXRelationalExpression_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXRelationalExpression_Type
in class AbstractXbaseProposalProvider
completeJavaTypes
protected void completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
ICompletionProposalAcceptor acceptor)
completeJavaTypes
protected void completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
completeJavaTypes
protected void completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
IValueConverter<java.lang.String> valueConverter,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
completeJavaTypes
protected void completeJavaTypes(ContentAssistContext context,
org.eclipse.emf.ecore.EReference reference,
boolean forced,
IValueConverter<java.lang.String> valueConverter,
ITypesProposalProvider.Filter filter,
ICompletionProposalAcceptor acceptor)
completeXTypeLiteral_Type
public void completeXTypeLiteral_Type(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXTypeLiteral_Type
in class AbstractXbaseProposalProvider
completeXFeatureCall_DeclaringType
public void completeXFeatureCall_DeclaringType(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXFeatureCall_DeclaringType
in class AbstractXbaseProposalProvider
proposeDeclaringTypeForStaticInvocation
public void proposeDeclaringTypeForStaticInvocation(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
completeKeyword
public void completeKeyword(Keyword keyword,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeKeyword
in class AbstractJavaBasedContentProposalProvider
isKeywordWorthyToPropose
protected boolean isKeywordWorthyToPropose(Keyword keyword)
doCreateIntProposals
protected boolean doCreateIntProposals()
- Overrides:
doCreateIntProposals
in class TerminalsProposalProvider
doCreateIdProposals
protected boolean doCreateIdProposals()
- Overrides:
doCreateIdProposals
in class TerminalsProposalProvider
doCreateStringProposals
protected boolean doCreateStringProposals()
- Overrides:
doCreateStringProposals
in class TerminalsProposalProvider
getScopeProvider
public XbaseScopeProvider getScopeProvider()
- Overrides:
getScopeProvider
in class AbstractJavaBasedContentProposalProvider
lookupCrossReference
protected void lookupCrossReference(CrossReference crossReference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
- Overrides:
lookupCrossReference
in class AbstractJavaBasedContentProposalProvider
completeXAssignment_Feature
public void completeXAssignment_Feature(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXAssignment_Feature
in class AbstractXbaseProposalProvider
getXAssignmentFeatureAssignment
protected Assignment getXAssignmentFeatureAssignment()
completeXFeatureCall_Feature
public void completeXFeatureCall_Feature(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXFeatureCall_Feature
in class AbstractXbaseProposalProvider
getXForLoopRightParenthesis
protected Keyword getXForLoopRightParenthesis()
completeXBlockExpression_Expressions
public void completeXBlockExpression_Expressions(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXBlockExpression_Expressions
in class AbstractXbaseProposalProvider
completeXCasePart_Then
public void completeXCasePart_Then(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXCasePart_Then
in class AbstractXbaseProposalProvider
completeXCasePart_Case
public void completeXCasePart_Case(org.eclipse.emf.ecore.EObject model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
- Overrides:
completeXCasePart_Case
in class AbstractXbaseProposalProvider
lookupCrossReference
protected void lookupCrossReference(CrossReference crossReference,
org.eclipse.emf.ecore.EReference reference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor,
com.google.common.base.Predicate<IEObjectDescription> filter)
- Customized to be able to treat binary operations in a special way with respect to scoping.
Since the operator is a cross reference, we have to be careful to choose the right context for
the scope provider. On the other hand it's important to filter "impossible" syntactical situations.
- Overrides:
lookupCrossReference
in class AbstractJavaBasedContentProposalProvider
createLocalVariableAndImplicitProposals
protected void createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
int idx,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
createLocalVariableAndImplicitProposals
protected void createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
boolean includeCurrentObject,
int idx,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
getFeatureCallRuleName
protected java.lang.String getFeatureCallRuleName()
createLocalVariableAndImplicitProposals
protected void createLocalVariableAndImplicitProposals(org.eclipse.emf.ecore.EObject context,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor)
- Create proposal for
simple feature calls
that use an IdOrSuper
as concrete syntax.
createReceiverProposals
protected void createReceiverProposals(XExpression receiver,
CrossReference crossReference,
org.eclipse.emf.ecore.EReference reference,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor,
com.google.common.base.Predicate<IEObjectDescription> filter)
doNotProposeFeatureOfBinaryOperation
protected boolean doNotProposeFeatureOfBinaryOperation(ContentAssistContext contentAssistContext,
XBinaryOperation binaryOperation)
isParentOf
protected boolean isParentOf(INode node,
INode child)
getProposalFactory
protected com.google.common.base.Function<IEObjectDescription,org.eclipse.jface.text.contentassist.ICompletionProposal> getProposalFactory(java.lang.String ruleName,
ContentAssistContext contentAssistContext)
- Overrides:
getProposalFactory
in class AbstractJavaBasedContentProposalProvider
getStyledDisplayString
protected org.eclipse.jface.viewers.StyledString getStyledDisplayString(JvmFeature feature,
boolean withParenths,
int insignificantParameters,
java.lang.String qualifiedNameAsString,
java.lang.String shortName)
appendParameters
protected void appendParameters(org.eclipse.jface.viewers.StyledString result,
JvmExecutable executable,
int insignificantParameters)
getFeatureDescriptionPredicate
protected com.google.common.base.Predicate<IEObjectDescription> getFeatureDescriptionPredicate(ContentAssistContext contentAssistContext)
getQualifiedNameValueConverter
protected QualifiedNameValueConverter getQualifiedNameValueConverter()
isIdRule
protected boolean isIdRule(java.lang.String ruleName)