int (PsiElement arg, GrCall call) { final GroovyResolveResult result = call.advancedResolve(); if (!(result.getElement() instanceof PsiMethod method)) return -1; final Map<GrExpression, Pair<PsiParameter, PsiType>> map = GrClosureSignatureUtil .mapArgumentsToParameters(result, call, false, false, call.getNamedArguments(), call.getExpressionArguments(), call.getClosureArguments()); if (map == null) return -1; final PsiParameter parameter = map.get(arg).first; if (parameter == null) return -1; return method.getParameterList().getParameterIndex(parameter); }