Boolean (@NotNull PsiExpressionList pattern, @NotNull PsiExpressionList candidate, @NotNull List<PsiElement> candidates, @NotNull Match match) { final PsiExpression[] expressions = pattern.getExpressions(); final PsiExpression[] childExpressions = candidate.getExpressions(); if (expressions.length > 0 && expressions[expressions.length - 1] instanceof PsiReferenceExpression) { final PsiElement resolved = ((PsiReferenceExpression)expressions[expressions.length - 1]).resolve(); if (resolved instanceof PsiParameter && ((PsiParameter)resolved).getType() instanceof PsiEllipsisType) { for (int i = 0; i < expressions.length - 1; i++) { final Parameter parameter = expressions[i].getUserData(PARAMETER); if (parameter == null) { if (!matchPattern(expressions[i], childExpressions[i], candidates, match)) { return false; } } else if (!match.putParameter(parameter, childExpressions[i])) return false; } final Parameter param = expressions[expressions.length - 1].getUserData(PARAMETER); if (param == null) return false; for (int i = expressions.length - 1; i < childExpressions.length; i++) { if (!match.putParameter(param, childExpressions[i])) return false; } return true; } } return null; }