boolean (@Nullable PsiElement pattern, @Nullable PsiElement candidate, @NotNull List<PsiElement> candidates, @NotNull Match match) { if (myMatchType == MatchType.EXACT || !(pattern instanceof PsiExpression) || !(candidate instanceof PsiExpression)) { return false; } if (myPattern.length == 1 && isSameExpression(myPattern[0], (PsiExpression)pattern)) { return false; } if (myPatternComplexityHolder == null) { myPatternComplexityHolder = new ComplexityHolder(myPatternAsList); } ExtractableExpressionPart patternPart = ExtractableExpressionPart.match((PsiExpression)pattern, myPatternAsList, myPatternComplexityHolder); if (patternPart == null) { return false; } if (myCandidateComplexityHolder == null || myCandidateComplexityHolder.getScope() != candidates) { myCandidateComplexityHolder = new ComplexityHolder(candidates); } ExtractableExpressionPart candidatePart = ExtractableExpressionPart.match((PsiExpression)candidate, candidates, myCandidateComplexityHolder); if (candidatePart == null) { return false; } if (patternPart.myValue != null && patternPart.myValue.equals(candidatePart.myValue)) { return true; } if (patternPart.myVariable == null || candidatePart.myVariable == null) { return match.putExtractedParameter(patternPart, candidatePart); } return false; }