Xtext 2.4.2: content assist: how to use a filter in completeRuleCall ? [message #1075135] |
Sun, 28 July 2013 21:16 |
J A Messages: 31 Registered: July 2013 |
Member |
|
|
Dear all,
For content assist, I can use a filter to help accepting/refusing some AST's element if that's a lookupCrossReference, but I cannot do the same thing with completeRuleCall.
Example:
public class MyModelProposalProvider extends AbstractFinancialProposalProvider
// I could filter the cross-referencings that I don't like
public void completeProductionReturnType1_FeatureName1(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
Predicate<IEObjectDescription> booleanFilter = new Predicate<IEObjectDescription>()
{
public boolean apply(IEObjectDescription ieod)
{
// Return true/false basing on your liking here
}
};
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor, booleanFilter);
}
// But I cannot do anything to the completeRuleCall()
public void completeProductionReturnType2_FeatureName2(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
}
Do you suggest how I could do manipulate the call to completeRuleCall(), can I manipulate its "context" or "acceptor" ???
[Updated on: Sun, 28 July 2013 21:18] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05232 seconds