Hi, is it possible to get the object class which w...
# ksp
p
Hi, is it possible to get the object class which was used in a companion object's constructor with ksp ?
Copy code
companion object : EntityClass<ULong, GuildSetting>(GuildSettings)
from the companion object above I'd need the GuildSettings argument ? I'm rather new to ksp so I don't know all the jargon yet
y
If you resolve the type of the companion object, it should return a type where you can inspect type arguments
There you should be able to resolve it
p
I only find the generic parameters <ULong, GuildSetting> on the companion KSClassDeclaration of the companion object
Here is a bit more context. I am processing the Cacheable tag. and my classes look like this:
e
You cannot get the argument of the constructor as its an expression level information. KSP will not help here. Either use a fully fledged compiler plugin or find a way to encode the argument class in a symbol that KSP can read eg annotation etc
p
I see, thanks for the replies :)