use of org.eclipse.xtext.ui.editor.contentassist.IFollowElementAcceptor in project xtext-eclipse by eclipse.
the class CodetemplatesProposalProvider method createNestedProposals.
public void createNestedProposals(ContentAssistContext[] contexts, ITextViewer originalViewer, final ICompletionProposalAcceptor acceptor, TemplateData data) {
for (ContentAssistContext context : contexts) {
Builder builder = context.copy();
builder.setViewer(originalViewer);
ContentAssistContext myContext = builder.toContext();
IFollowElementAcceptor selector = createNestedSelector(myContext, acceptor, data);
for (AbstractElement element : myContext.getFirstSetGrammarElements()) {
selector.accept(element);
}
}
}
use of org.eclipse.xtext.ui.editor.contentassist.IFollowElementAcceptor in project xtext-eclipse by eclipse.
the class DefaultTemplateProposalProvider method getContextTypes.
@Override
protected TemplateContextType[] getContextTypes(final ContentAssistContext context) {
final Set<TemplateContextType> result = Sets.newLinkedHashSet();
IFollowElementAcceptor acceptor = createFollowElementAcceptor(result);
List<AbstractElement> grammarElements = context.getFirstSetGrammarElements();
for (AbstractElement element : grammarElements) acceptor.accept(element);
return result.toArray(new TemplateContextType[result.size()]);
}
Aggregations