I gather that there are multiple compiler apis. Wh...
# compiler
p
I gather that there are multiple compiler apis. Where can I find information about their names and documentation (javadoc would be good)? Especially the api for which KtElement is found.
j
there's some good arrow-meta videos that go through the pinball dynamic of laying this stuff out @raulraja might be on top of the latest and greatest
r
The compiler apis are continually changing and while there are some videos or blogs that show the technique, what I follow is to download the kotlin sources and index them in IDEA. Once you have that you can find usages of
ProjectExtensionDescriptor
. This is what compiler plugins register on each phase to get called back and alter compilation. All plugins implement
ComponentRegistrar
which allows you to subscribe those ProjectExtensionDescriptor. You can find in this file all phases Arrow Meta registers to https://github.com/arrow-kt/arrow-meta/blob/48982f09f691afc9c915213e308d6591046721[…]rc/main/kotlin/arrow/meta/internal/registry/InternalRegistry.kt . We don’t recommend you use Arrow meta for compiler development until the IR backend is announced stable in 1.5.0 and we have a better idea of what compiler plugins look there. I expect 1.5.0 if it supports compiler plugins to have the corresponding IDE integration which is what currently make many compiler plugins not possible. While the Kotlin plugin bundles support for it’s own needs in IDEA for its own plugins, community plugins won’t be able to get correct IDE behavior until the Kotlin IDE plugin has support for descriptors and other things that are currently redline if you use a third party compiler plugin. IMO We can’t expect every library to ship its own IDEA plugins that people have to discover through a marketplace once compiler plugins are officially supported.
p
@jimn and @raulraja Freaking awesome!