Example usage for org.eclipse.jdt.core IType codeComplete

List of usage examples for org.eclipse.jdt.core IType codeComplete

Introduction

In this page you can find the example usage for org.eclipse.jdt.core IType codeComplete.

Prototype

void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames,
        char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic,
        CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException;

Source Link

Document

Do code completion inside a code snippet in the context of the current type.

Usage

From source file:org.eclipse.objectteams.otdt.tests.model.AbstractJavaModelCompletionTests.java

License:Open Source License

protected CompletionResult snippetContextComplete(IType type, String snippet, int insertion, int cursorLocation,
        boolean isStatic) throws JavaModelException {
    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
    type.codeComplete(snippet.toCharArray(), insertion, cursorLocation, null, null, null, isStatic, requestor,
            this.wcOwner);

    CompletionResult result = new CompletionResult();
    result.proposals = requestor.getResults();
    result.context = requestor.getContext();
    result.cursorLocation = cursorLocation;
    return result;
}