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