public void apply(ICompletionReporter reporter) throws Exception
{
try {
FunctionContext ctx = (FunctionContext) getContext();
TwigModelAccess model = TwigModelAccess.getDefault();
String prefix = ctx.getPrefix();
SourceRange range = getReplacementRange(getContext());
Function[] functions = model.getFunctions(ctx.getSourceModule()
.getScriptProject());
for (Function function : functions) {
if (CodeAssistUtils.startsWithIgnoreCase(
function.getElementName(), prefix)) {
function.setScriptProject(ctx.getSourceModule()
.getScriptProject());
reporter.reportType(function, "()", range);
}
}