IntelliJ Idea 更改粘贴的代码

IntelliJ Idea changes pasted code

当使用 "static" 导入从另一个 class 粘贴 Kotlin 代码时,例如:

@SpringBootTest(webEnvironment = RANDOM_PORT)

我想IDE像这样添加导入

import org.springframework.boot.test.context.SpringBootTest.WebEnvironment.*

但不是那个 IntelliJ Idea(版本 2018.1.1)而是将粘贴的代码更改为

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)

并添加

import org.springframework.boot.test.context.SpringBootTest

这是错误还是功能,我可以更改它吗?

这是当前版本的Kotlin插件的一个缺点。我已提交 an issue 以改进未来版本中的行为。