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
jw
03/28/2023, 1:32 AM
That is just how it works
jw
03/28/2023, 1:32 AM
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
asdf asdf
03/28/2023, 2:53 AM
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
Mark Vogel
03/28/2023, 2:40 PM
Do you know how Kotlinx accomplishes that error in the IDE?