@Override
public void insertFunction(JTextComponent textArea) {
textArea.replaceSelection("");
int pos = textArea.getCaretPosition();
CompletionToken token = getCompletionToken(pos, pos, textArea);
token.complete(textArea.getDocument());
}
@Override
public CompletionToken getCompletionToken(int startPos, int cursorPos, JTextComponent textArea) {
FunctionCompletionToken token = new FunctionCompletionToken(function, startPos, cursorPos, textArea);