Working on a KSP interop artifact for KotlinPoet, ...
# ksp
z
Working on a KSP interop artifact for KotlinPoet, if KSP folks have some time I'd love extra eyes on this! https://github.com/square/kotlinpoet/pull/1146
👍🏻 1
👍 4
❤️ 1
🙏 5
🙏🏻 1
j
Thanks for the PR. Sorry I didn’t notice it timely. Pinging us on github might get a sooner response, in case you need us in similar scenarios in the future.
z
No rush! Feedback welcome still, we’re actively working on this so this won’t be the last PR and open to change. Actually have another one up now with some more interop APIs plus starting test infra for it https://github.com/square/kotlinpoet/pull/1148
j
#1146 looks good overall. Have a minor comment on #1148 but I assume that is not very related to KSP itself
i
Excellent work but I have an error here [ksp] java.lang.IllegalArgumentException: no type arguments: .User where kstype is the type is List<User>
solved it by adding this line
Copy code
is KSClassDeclaration -> {
    if (decl.typeParameters.isEmpty())
        decl.toClassName()
    else decl.toClassName()
        .parameterizedBy(
            arguments.map {
                it.toTypeName(typeParamResolver)
            })
}
in KsTypes
Copy code
public fun KSType.toTypeName(
    typeParamResolver: TypeParameterResolver = TypeParameterResolver.EMPTY
): TypeName {
    val type = when (val decl = declaration) {
        is KSClassDeclaration -> {
z
please use the issue tracker with a repro case in the future
i
OK, sorry for disturping