private boolean isSelf(@NotNull PsiElement candidate) {
    for (PsiElement pattern : myPattern) {
      ProgressManager.checkCanceled();
      if (PsiTreeUtil.isAncestor(pattern, candidate, false)) {
        return true;
      }
    }
    return false;
  }
private boolean isSelf(@NotNull PsiElement candidate)