Search in sources :

Example 1 with ITypesProposalProvider

use of org.eclipse.xtext.common.types.xtext.ui.ITypesProposalProvider in project xtext-xtend by eclipse.

the class XtendJavaDocCompletionProposalComputer method exec.

@Override
public ICompletionProposal[] exec(XtextResource resource) throws Exception {
    List<ContentAssistContext> contexts = Arrays.asList(protocol.getContextFactory().create(viewer, offset, resource));
    if (contexts.size() > 0) {
        ContentAssistContext contentAssistContext = contexts.get(contexts.size() - 1);
        if (isValidPositionForTypeProposal(contentAssistContext)) {
            ITypesProposalProvider typesProposalProvider = protocol.getTypesProposalProvider();
            typesProposalProvider.createTypeProposals(protocol.getProposalFactory(), contentAssistContext, TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, this);
        }
    }
    return proposals.toArray(new ICompletionProposal[proposals.size()]);
}
Also used : ContentAssistContext(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext) ITypesProposalProvider(org.eclipse.xtext.common.types.xtext.ui.ITypesProposalProvider)

Aggregations

ITypesProposalProvider (org.eclipse.xtext.common.types.xtext.ui.ITypesProposalProvider)1 ContentAssistContext (org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext)1