void (@NotNull PsiPackage context, String @NotNull [] extendClasses, Consumer<? super LookupElement> result) { GlobalSearchScope packageScope = PackageScope.packageScope(context, true); GlobalSearchScope scope = myJavaClassReferenceSet.getProvider().getScope(getElement().getProject()); if (scope != null) { packageScope = packageScope.intersectWith(scope); } GlobalSearchScope allScope = ProjectScope.getAllScope(context.getProject()); boolean instantiatable = JavaClassReferenceProvider.INSTANTIATABLE.getBooleanValue(getOptions()); boolean notInterface = JavaClassReferenceProvider.NOT_INTERFACE.getBooleanValue(getOptions()); boolean notEnum = JavaClassReferenceProvider.NOT_ENUM.getBooleanValue(getOptions()); boolean concrete = JavaClassReferenceProvider.CONCRETE.getBooleanValue(getOptions()); ClassKind classKind = getClassKind(); for (String extendClassName : extendClasses) { PsiClass extendClass = JavaPsiFacade.getInstance(context.getProject()).findClass(extendClassName, allScope); if (extendClass != null) { // add itself if (packageScope.contains(extendClass.getContainingFile().getVirtualFile())) { if (isClassAccepted(extendClass, classKind, instantiatable, concrete, notInterface, notEnum)) { result.consume(createSubclassLookupValue(extendClass)); } } for (PsiClass clazz : ClassInheritorsSearch.search(extendClass, packageScope, true)) { String qname = clazz.getQualifiedName(); if (qname != null && isClassAccepted(clazz, classKind, instantiatable, concrete, notInterface, notEnum)) { result.consume(createSubclassLookupValue(clazz)); } } } } }