private boolean classMatchesFilter(PsiClass aClass) {
        if (!searchScope.accept(aClass.getContainingFile().getVirtualFile()))
            return false;

        if (targetDirectory != null) {
            PsiPackage targetPackage = JavaDirectoryService.getInstance().getPackage(targetDirectory);
            if (targetPackage != null) {
                PsiDirectory directory = aClass.getContainingFile().getContainingDirectory();
                PsiPackage classPackage = JavaDirectoryService.getInstance().getPackage(directory);
                if (classPackage != null
                    && !targetPackage.getQualifiedName().equals(classPackage.getQualifiedName()))
                {
                    return false;
                }
            }
        }

        if (!(aClass instanceof KtLightClassForSourceDeclaration)) return false;
        KtClassOrObject classOrObject = ((KtLightClassForSourceDeclaration) aClass).getKotlinOrigin();

        if (classOrObject instanceof KtObjectDeclaration) {
            return !((KtObjectDeclaration) classOrObject).isObjectLiteral();
        }

        if (classOrObject instanceof KtClass ktClass) {
          return !(ktClass.isInner() || ktClass.isAnnotation());
        }

        return false;
    }
private boolean classMatchesFilter(PsiClass aClass)