Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intelij won't show sources for some kotlin classes

I was playing around with Kotlin, when I stumbled upon some problems while looking through some documentation. I saw that some classes do not have source code attached. For example, there seems to be no source code/javadoc for the SetsKt.class, even though there is plenty for the other classes. Is there any specific reason for this?

Kind regards, Jelmerenter image description here

like image 507
jelmew Avatar asked Jan 24 '26 23:01

jelmew


1 Answers

quote from jetbrains issue:

The reason for this behaviour is that facade class files (like FilesKt.class) can be generated from several kotlin source files. So when you click on such a file it's not entirely obvious what you want to see. So we went with a conservative decision to show (admittedly ugly) decompiled code for such files, which contain all the declarations inside as opposed to showing some source file (which may not contain the declaration you're looking for). We can improve the behaviour so that when class file is generated from only one Kotlin file it takes you to that file directly but this will not necessarily help with more complex cases (such as kotlin-runtime) when single class file is generated from several source files.

like image 145
jelmew Avatar answered Jan 27 '26 01:01

jelmew