GroovyResolveResult (@Nullable GrExpression caller, @NotNull String methodName, GrExpression @NotNull [] exprs, GrNamedArgument @NotNull [] namedArgs, GrClosableBlock @NotNull [] closureArgs, @NotNull GroovyPsiElement psiContext) { GroovyResolveResult call = EmptyGroovyResolveResult.INSTANCE; final PsiType type; if (caller == null) { type = GroovyPsiElementFactory.getInstance(psiContext.getProject()).createExpressionFromText("this", psiContext).getType(); } else { type = caller.getType(); } if (type != null) { final PsiType[] argumentTypes = PsiUtil.getArgumentTypes(namedArgs, exprs, closureArgs, false, null); final GroovyResolveResult[] candidates = ResolveUtil.getMethodCandidates(type, methodName, psiContext, argumentTypes); call = PsiImplUtil.extractUniqueResult(candidates); } return call; }