Federico Tomassetti

06/14/2023, 8:58 AM
I am trying to parse Kotlin code using the kotlin-compiler-embeddable. I tried following the advice presented in this article but it seems outdated
I can parse code and I can get KtClass, but then when I try to resolve types I get an exception about the KotlinCacheService not being available
KotlinCoreEnvironment seems to be deprecated, so maybe this is the issue. I was wondering if you have any suggestions on how to use the Kotlin compiler with version 1.8.20

Didier Villevalois

06/19/2023, 4:20 PM
Hi @Federico Tomassetti! I did not try to run it yet but maybe this code from OpenRewrite can help you:

Federico Tomassetti

06/20/2023, 6:02 AM
Thank you Didier, I will look into it