Query<PsiClass> (@NotNull PsiClass aClass, boolean checkDeep) { return search(aClass, ReadAction.compute(() -> { if (!aClass.isValid()) { throw new ProcessCanceledException(); } PsiFile file = aClass.getContainingFile(); return PsiSearchHelper.getInstance(aClass.getProject()).getUseScope(file != null ? file : aClass); }), checkDeep); }