boolean (GrClosableBlock closure, PsiScopeProcessor processor, GrReferenceExpression refExpr, ResolveState state) { PsiElement parent = closure.getParent(); if (parent instanceof GrArgumentList) parent = parent.getParent(); if (!(parent instanceof GrMethodCall)) return true; PsiMethod psiMethod = ((GrMethodCall)parent).resolveMethod(); if (psiMethod == null) return true; List<GroovyMethodInfo> infos = GroovyMethodInfo.getInfos(psiMethod); if (infos.isEmpty()) return true; int index = PsiUtil.getArgumentIndex((GrMethodCall)parent, closure); if (index == -1) return true; for (GroovyMethodInfo info : infos) { GroovyMethodDescriptor.ClosureArgument[] closureArguments = info.getDescriptor().myClosureArguments; if (closureArguments != null) { for (GroovyMethodDescriptor.ClosureArgument argument : closureArguments) { if (argument.index == index && argument.methodContributor != null) { ClosureMissingMethodContributor instance = SingletonInstancesCache.getInstance(argument.methodContributor, info.getPluginClassLoader()); if (!instance.processMembers(closure, processor, refExpr, state)) return false; } } } } return true; }