boolean (Object element, PsiElement scope) { if (!(element instanceof PsiElement context)) return false; for(int i = 0; i < myLevel && context != null; i++){ context = context.getContext(); } if(context != null){ if(myParent == null){ return getFilter().isAcceptable(context, scope); } return myParent == context; } return false; }