Symbol solver API in Kotlin


#1

Hello community!

I parse Kotlin code using the PsiFileFactory for code analysis. The resulting abstract syntax tree contains no type information.
Now I wanted to know how I can use the symbol solver from the Kotlin compiler to accomplish type resolution.
Can you give me a hint or starting point?

Thanks for your consideration!


#2

This is unfortunately not particularly easy to use, not stable and not documented, but you can look at how Dokka uses it: https://github.com/Kotlin/dokka/blob/master/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt