boolean (GrReferenceExpression ref) { if (ref.resolve() != null) return false; GroovyResolveResult[] results = ref.multiResolve(true); for (GroovyResolveResult result : results) { final PsiElement element = result.getElement(); if (element instanceof PsiMethod) { final PsiParameter[] parameters = ((PsiMethod)element).getParameterList().getParameters(); if (parameters.length == 1 && parameters[0].getType().equalsToText(GroovyCommonClassNames.GROOVY_LANG_CLOSURE)) { return true; } } } return false; }