do we have docs, yet, on how to write compiler plu...
# compiler
e
do we have docs, yet, on how to write compiler plugins for k2? i want to generate a method/class based on an annotation.
e
my hero. thanks.
🙂 1
h
BTW if you only want to generate a code based on an annotated function/type, you can also take a look at ksp, which is a high level abstraction for the compiler api.
j
IMO the experience the developer get with a compiler plugin is over KSP
h
I agree, it’s really good to know the internals of the compiler, if you care. If you don’t care and don’t want to use the unstable compiler plugin api, you can use ksp instead.
e
well, i'm actually going to be adding a function to the annotated class so I'd need access to the IR inject my new method during the compile phase.
i'd written, essentially, KSP before google came along and built theirs so i'm accustomed to working with the older PSI/IR APIs at least. was just holding off building this plugin because I knew K2 was coming and Changing Everything™️
❤️ 1