Open edenman opened 2 years ago
I think that would need to be a separate library. I do wish they'd offer better answers here for 3rd party plugins. What will happen when they break compose? "Sorry this wasn't supported anyway bye". Anvil has experienced similar issues as well.
Cool, thanks for the quick reply! I'll post here if I end up open-sourcing something
Ok so https://github.com/ZacSweers/redacted-compiler-plugin/issues/16 and https://github.com/ZacSweers/redacted-compiler-plugin/issues/24 raised this, but I felt like it was worth reopening since redacting fields in a kotlinx
@Serializable
class actually seems like a very common usecase.The problem: the compiler plugin infrastructure doesn't currently support multiple compiler plugins operating on the same class if they both need to look at the constructors of the class. Kotlinx serialization uses a compiler plugin, so Redacted's compiler breaks.
Possible solution: Add a KSP plugin to generate a new
possiblyRedactedToString()
method for all@Serializable
classes. Then still use a compiler plugin to replacetoString()
but instead of doing it only if a@Redacted
annotation is present, do it for all@Serializable
classes.I think this would work, but it's probably too niche to support for this library. What do you think?