use of org.eclipse.xtext.ide.editor.contentassist.IFollowElementAcceptor in project n4js by eclipse.
the class PatchedFollowElementComputer method computeFollowElements.
@Override
public void computeFollowElements(Collection<FollowElement> followElements, final IFollowElementAcceptor followElementAcceptor) {
FollowElementCalculator calculator = feCalculatorProvider.get();
calculator.setAcceptor(new IFollowElementAcceptor() {
@Override
public void accept(AbstractElement element) {
ParserRule rule = GrammarUtil.containingParserRule(element);
if (rule == null || !GrammarUtil.isDatatypeRule(rule))
followElementAcceptor.accept(element);
}
});
for (FollowElement element : followElements) {
List<Integer> paramStack = element.getParamStack();
if (!paramStack.isEmpty()) {
calculator.setParameterConfig(paramStack.get(paramStack.size() - 1));
} else {
calculator.setParameterConfig(0);
}
computeFollowElements(calculator, element);
}
}
Aggregations