boolean (@NotNull T t, final ProcessingContext context) { PsiElement element = t; while (element != null) { if (pattern.accepts(element, context)) { return element.getTextRange().getStartOffset() == t.getTextRange().getStartOffset(); } element = element.getContext(); } return false; }