Android Studio 3.0 Preview Missing Imports when refactoring Kotlin code

Viewed 1069

Whenever I try to refactor Koltin code on Android Studio 3.0 it simply removes all my "top level" imports and starts using "inplace" imports.

By refactoring I mean, in this case, moving code around. So let's say I have a class under com.myapp package. If I move it to com.myapp.anotherpackage this issue happens

Funny fact about this looks like it only happens when you move more than one file at the same time

What it looks like:

//Before refactoring I have this import
import android.support.v7.app.AppCompatActivity;

class MyActivity : AppCompatActivity() {
    //code
}

Then after refactoring it goes like this

//"top level" import is gone

class MyActivity : android.support.v7.app.AppCompatActivity() { //"inline" import
    //code
}

enter image description here

It gets even worse if I have to refactor the code again, as every single import is "inlined", the android studio doesn't refactor those, and I have to do fix them by hand. This is getting really annoying already, as I had to fix over 100 of these. Any thoughts on how to fix this?

4 Answers
Related