I'm developing a Kotlin compiler plugin that gener...
# compiler
m
I'm developing a Kotlin compiler plugin that generates a class for functions annotated with a specific annotation. The plugin works correctly—code compiles and runs as expected—but the generated class is not recognized by Android Studio (Unresolved reference and no autocompletion). The class is generated during the FIR phase. However, I want the generated class to be visible and accessible in the IDE without requiring a full build or compilation of the app—ideally as if it were regular source code. Is it possible to achieve this kind of integration so that Android Studio can recognize and index the class at development time?
y
KSP may fare better here
m
Thank you for your answer, but I guess KSP makes the class after a build, but I need something that make the class in FIR, so it should be accessible without a build (I mean IDE should see the class without build) example:
Copy code
@ArgMk
fun myFunction(a : Int, b : Int)

// class myFunctionArg should be accessible in the same file without a build.
If we change the name of function, the class name should change immediately as well. is this possible?
I can see something similar in kotlinx.serialization compiler plugin when we just annotate a class then its companion object is accessible immediately without build in IDE. I'm trying to do the same
m
Ah, thank you so much 🙏