Are there any examples how to decompile FIR (FirEl...
# compiler
i
Are there any examples how to decompile FIR (FirElement) to source code String?
d
We have two renderers for FIR: 1.
FirRenderer
renders fir tree to something like original source but with additional resolve information https://github.com/JetBrains/kotlin/blob/master/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt 2.
MultiModuleHtmlFirDump
renders fir to html which represents original source code (modulo some desugarings which compiler performs on stage of building FIR from PSI) with render info which is hidden using interactive html elements https://github.com/JetBrains/kotlin/blob/master/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt
So you can use one of those classes and modify them for your need or implement your own renderer which will be more suitable for your usecase