Get constructor paramaters with name and fully qualified name of type from KtClass

Answered

I am trying to get primary constructor parameters with their fully qualified type name but I am only able to get the type name as String without package name. Is there any way to get fqName for parameter type from primary and secondary constructors?

    ktFile.children.filterIsInstance<KtClass>().forEach { clazz ->
        clazz.primaryConstructor?.let {
            parsePrimaryConstructor(imports, it.valueParameters)
        }
        clazz.secondaryConstructors.forEach {
            parsePrimaryConstructor(imports, it.valueParameters)
        }
    }
0

Please sign in to leave a comment.