Object[] (String completionPrefix, PsiElement location, ProcessingContext context) { final TypeEvalContext typeEvalContext = TypeEvalContext.codeCompletion(location.getProject(), location.getContainingFile()); final PyClassType delegate; if (location instanceof PyReferenceExpression) { delegate = selectCallableType(((PyReferenceExpression)location).getQualifier(), typeEvalContext); } else { final PyClass cls = PyPsiFacade.getInstance(myCallable.getProject()).createClassByQName(PyNames.TYPES_FUNCTION_TYPE, myCallable); delegate = cls != null ? new PyClassTypeImpl(cls, false) : null; } if (delegate == null) { return ArrayUtilRt.EMPTY_OBJECT_ARRAY; } return delegate.getCompletionVariants(completionPrefix, location, context); }