boolean (final @NotNull PsiFile psiFile) { if (!psiFile.isValid()) return false; SearchScope scope = myScopes.getSelectedScope(); VirtualFile file = psiFile.getVirtualFile(); boolean isAffected = scope != null && file != null && scope.contains(file); return isAffected && acceptTodoFilter(psiFile); }