I'm starting to explore KSP to write an annotation...
# ksp
m
I'm starting to explore KSP to write an annotation processor. One thing I'm curious about is errors, specifically showing errors in the IDE. For example, in Kotlinx Serialization, if one of the properties doesn't have a serializer it will show an error. How can I do that with KSP? In my testing so far, I've only been able to get the error to show by calling
env.logger.error(..., node)
, but it only shows when attempting to build and not actually in the IDE.
j
That is just how it works
Maybe if you do a build in the IDE it will display in the IDE, but you will not see things in real time
a
Yeah can't really do that just using KSP since it's only ran during build, however I think I've heard that when FIR plugin api & K2 ide are ready compiler plugin errors will be able to render in ide (if anyone is able confirm/deny that would be great to know)
m
Do you know how Kotlinx accomplishes that error in the IDE?
j
Their compiler plugin is built in to Kotlin
m
I see that makes sense. Thanks for the insight!