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)
}
}
Please sign in to leave a comment.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/14717107954962-How-can-I-get-fully-qualified-name-of-a-KtParameter-type ?