IntelliJ always gets itself tied into a knot when ...
# intellij
n
IntelliJ always gets itself tied into a knot when renaming a package in a Kotlin project. Every time a package is renamed IntelliJ creates two folders, and the Project view doesn't display the package(s) properly.
m
I'll assume you renamed 'gui_vista' to 'guivista'. It creates the folders for the new package, and copies over the files within it, but doesn't cleanup the old package folders. As to the display, as you haven't told us what you expect, we can't help. There are several options related to how IntelliJ shows packages, so it's very likely you need to change one of those to see what you want to see.
n
Mike - Your'e assumption is correct. I did the renaming for the purpose of reproducing the problem (the actual root package is org.gui_vista). Just realised that the root package should be renamed to org.guiVista to fit in with the Kotlin Coding Conventions ( https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules ). Some other packages will also need to be renamed
Turns out that IntelliJ's Rename refactoring can break when applied on the root package. Have a boat load of work to do in order to clean up the mess that IntelliJ created, which has caused tons of compilation errors 😱.
Below is some of the mess that IntelliJ has created:
Copy code
class SizeGroup(sizeGroupPtr: CPointer<GtkSizeGroup>? = null,
                mode: GtkSizeGroupMode = GtkSizeGroupMode.GTK_SIZE_GROUP_NONE) : _root_ide_package_.org.guiVista.core.ObjectBase {
    // ...
}
a
Hello. In general, packages are not displayed properly in MPP projects, see https://youtrack.jetbrains.com/issue/KT-26846#focus=streamItem-27-3900223.0-0. However, I failed to reproduce this case of folder doubling. If possible, please file an issue at http://kotl.in/issue with a sample project to reproduce. Thanks.