GrMethodCall (@NotNull GrFunctionalExpression expression) { PsiElement parent = expression.getParent(); if (parent instanceof GrMethodCall && ArrayUtil.contains(expression, ((GrMethodCall)parent).getClosureArguments())) { return (GrMethodCall)parent; } if (parent instanceof GrArgumentList) { PsiElement grandparent = parent.getParent(); if (grandparent instanceof GrMethodCall) { return (GrMethodCall)grandparent; } } return null; }