Wouldn't it be possible to have better errors when KSP is applied to a project?
For instance, the dev does some refactoring and some interface is missing or the package of a class changed... but all I can see is KSP errors. I understand that KSP won't be able to work properly, but KSP errors hide the problems we have in code...
In this stack track I can't even see my projects code in the stacktrace and compiling the project again with "--stacktrace" does not help. Is there any way to allow me to see the java/kotlin errors in my code?
I ran into this a few days ago too. One of our internal processors threw an exception because it encountered an “Error” type when it expected a real implementation. The problem was that the import statement was missing.
unfortunately, since ksp runs before the kotlin compile task the import issue wasn’t shown at all in error logs and it was quite hard to figure out the root cause.
I updated our processor to check for the Error type case and not throw, but it is a bit difficult to always do that, and it seems like there should be a better way to ensure compilation errors with the compiler are always reported
10/12/2023, 8:26 PM
Definitely not an expert but I'd expect this to be a really hard problem. KSP generates symbols that can be used from your main source set. Running the Kotlin compiler before KSP isn't really an option for that reason.
A place where it could be implemented is for special processors that generate code that's only used by reflection like moshi for an example