void (@NotNull PsiElement element) { if (!selection.intersects(element.getTextRange())) { return; } if (filter.isInstance(element)) { results.add(filter.cast(element)); if (!searchChildrenOfFound) { return; } } super.visitElement(element); }