Search in sources :

Example 1 with ContentAssistContextFactory

use of org.eclipse.xtext.ide.editor.contentassist.antlr.ContentAssistContextFactory in project xtext-core by eclipse.

the class ContentAssistService method createProposals.

protected void createProposals(final String document, final TextRegion selection, final int caretOffset, final XtextResource resource, final IIdeContentProposalAcceptor acceptor) {
    int _length = document.length();
    boolean _greaterThan = (caretOffset > _length);
    if (_greaterThan) {
        return;
    }
    final ContentAssistContextFactory contextFactory = this.contextFactoryProvider.get();
    contextFactory.setPool(this.executorService);
    final ContentAssistContext[] contexts = contextFactory.create(document, selection, caretOffset, resource);
    this.proposalProvider.createProposals(((Collection<ContentAssistContext>) Conversions.doWrapArray(contexts)), acceptor);
}
Also used : ContentAssistContext(org.eclipse.xtext.ide.editor.contentassist.ContentAssistContext) Collection(java.util.Collection) ContentAssistContextFactory(org.eclipse.xtext.ide.editor.contentassist.antlr.ContentAssistContextFactory)

Aggregations

Collection (java.util.Collection)1 ContentAssistContext (org.eclipse.xtext.ide.editor.contentassist.ContentAssistContext)1 ContentAssistContextFactory (org.eclipse.xtext.ide.editor.contentassist.antlr.ContentAssistContextFactory)1