boolean (@NotNull PsiScopeProcessor processor, @NotNull PsiElement entrance, @Nullable PsiElement maxScope, @NotNull ResolveState state) { PsiElement prevParent = entrance; PsiElement scope = entrance; while (scope != null) { if (!scope.processDeclarations(processor, state, prevParent, entrance)) return false; if (scope == maxScope) break; prevParent = scope; scope = prevParent.getContext(); } return true; }