SearchScope () { if (myCachedScope == null) { TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject) .createAllProjectScopeChooser(JavaBundle.message("prompt.choose.base.class.of.the.hierarchy")); if (myRootClass != null) { chooser.select(myRootClass); } chooser.showDialog(); PsiClass aClass = chooser.getSelected(); if (aClass == null) { myCachedScope = LocalSearchScope.EMPTY; } else { final List<PsiElement> classesToSearch = new LinkedList<>(); classesToSearch.add(aClass); classesToSearch.addAll(ClassInheritorsSearch.search(aClass).findAll()); FunctionalExpressionSearch.search(aClass).forEach(expression -> { classesToSearch.add(expression); return true; }); myCachedScope = new LocalSearchScope(PsiUtilCore.toPsiElementArray(classesToSearch), JavaBundle.message("scope.hierarchy", ClassPresentationUtil.getNameForClass(aClass, true))); } } return myCachedScope; }