ArgInfo<PsiElement>[] (@NotNull GrSignature signature, @NotNull List<? extends InnerArg> innerArgs, boolean hasNamedArgs, boolean partial, @NotNull PsiElement context) { final ArgInfo<InnerArg>[] innerMap = mapParametersToArguments(signature, innerArgs.toArray(new InnerArg[0]), o -> o.type, context, partial); if (innerMap == null) return null; //noinspection unchecked ArgInfo<PsiElement>[] map = new ArgInfo[innerMap.length]; int i = 0; if (hasNamedArgs) { map[i] = new ArgInfo<>(innerMap[i].args.iterator().next().list, true, innerArgs.get(i).type); i++; } for (; i < innerMap.length; i++) { final ArgInfo<InnerArg> innerArg = innerMap[i]; if (innerArg == null) { map[i] = null; } else { List<PsiElement> argList = new ArrayList<>(); for (InnerArg arg : innerArg.args) { argList.addAll(arg.list); } boolean multiArg = innerArg.isMultiArg || argList.size() > 1; map[i] = new ArgInfo<>(argList, multiArg, innerArg.type); } } return map; }