Is anyone else having issues attaching sources for...
# compiler
s
Is anyone else having issues attaching sources for kotlin compiler? I understand kotlin-compiler-embeddable doesn't contain sources, but even when I attach kotlin-compiler-sources.jar I dont get good results. Example: while debugging if I Go to Type Source for a
DeserializedTypeAliasDescriptor
, it brings me to the decompiled class file. Meanwhile a symbol search gives the correct Kotlin source file
DeserializedMemberDescriptor.kt
. Any ideas? I have
compileOnly(kotlin("compiler-embeddable"))
in my gradle file, and
relocate("com.intellij", "<http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij")
when creating a JAR, but I dont believe that is relevant here as the package name is the same in both source and class file.
r
Hi @Strum355 Same issue here. On my local project I have an entire clone of the Kotlin sources which I use for that, switching to the right tag each time and reattaching the sources each time I do a full gradle import or clean. Also curious if there is a better way to keep the compiler sources navigable and debuggable in a stable form.
s
Has your method worked reliably? @raulraja If it does, Ill probably end up doing that instead 😬
r
It’s only reliable during the current session. Every time I do a gradle refresh or clean or close the IDE then the sources get detached, but I quickly hit the reattach and It’s saved in my file bookmarks for fast access. It’s annoying more than time consuming one you have all the sources locally.
🙏 1
r
I made a [PR](https://github.com/JetBrains/kotlin/pull/4449) to publish the sources, but it hasn't been reviews yet. It's simple enough you can do the same thing in your cloned repo and save the source jars, or publish them to maven local.
👀 2