raulraja
05/31/2021, 1:55 PMorg.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar
and looking into how to integrate with plugins that depend on org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
and org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
. I see AllOpen
and others are connected to the new FIR frontend and I was hoping to run some compiler plugin tests and work on the FIR support for arrow meta. I have a couple of questions that came up while I was working on this. Here it goes in case anyone can help.
1. The FirExtensionRegistrar
unlike the ComponentRegistrar
is not an interface but an abstract class and it requires a separate lifecycle. Once instantiated for regular CLI plugins and another for the FIR style of subscription. Did I miss-understood this or is there a way to integrate this with existing compiler plugins based on the ComponentRegistrar
?
2. Even when declaring both of those extensions and enabling FIR with configuration.put(CommonConfigurationKeys.USE_FIR, true)
the override for the FIR plugin`override fun ExtensionRegistrarContext.configurePlugin(): Unit` never gets called, Is there something else needed to enable FIR beside that flag?
If anyone has had success testing the FIR extension points or could provide any guidance or example as to how to enable them I’d very much appreciate it. Thanks!dmitriy.novozhilov
05/31/2021, 2:55 PMFirExtensionRegistrar
and corresponding infrastructure is a PoC prototype which we implemented a year ago. Currently there is no API for FIR compiler plugins. All FirExtensions you may find in project didn't work at all and will be changed in future, so it's meaningless to try to implement something with themraulraja
05/31/2021, 3:05 PMAnalysisExtension.doAnalysis
method to send all the KtFiles to Fir. If you have any pointers to code anywhere to launch FIR from analysis or other part that would make sense that may help. Thanks!dmitriy.novozhilov
05/31/2021, 3:09 PMraulraja
05/31/2021, 3:14 PMdmitriy.novozhilov
05/31/2021, 3:16 PMraulraja
05/31/2021, 3:16 PM