prevent import optimizing when copy/paste file

已回答

Hi,
can you point me to setting, which would prevent optimizing imports after copy pasting file in project tree? I've checked, that optimizing imports on the fly is disabled, inserting imports on paste as well. 
 

My code is as follows

fun main() {
    // do something
          testInput()
}

private fun testInput() {
    System.setIn(java.io.ByteArrayInputStream("abc".toByteArray()))
}

After copying and pasting the file, java.io.ByteArrayInputStream gets extracted to import section. 
 

Thanks,
Kamil

0
Have you tried "File | Settings | Editor | General | Auto Import | Java | Insert imports on paste"?
0

Yes, I've tried setting both Ask / Never. It did not help.

The issue is caused by some kind of automatic refactoring. It happens when moving source file between packages via drag and drop in project view as well.

0
To check it further, it would be better if you could share below info in a support ticket https://www.jetbrains.com/support/

1. The full project folder
2. A short video to demonstrate the issue
3. The zipped log folder

Alternatively, you can upload the needful to https://uploads.jetbrains.com/ and let us know the upload ID.
0

请先登录再写评论。