2014-12-28 40 views
7

編寫Java代碼時,IntelliJ會自動按名稱排序導入。但是,當Kotlin的成員入口時,他們仍然未排序。選擇代碼→優化進口(Ctrl + Alt + O)什麼都不做。IntelliJ不排序Kotlin導入

下面是一個例子:

import kotlin.platform.platformStatic 
import java.text.DateFormaty 
import org.hibernate.validator.constraints.NotEmpty as notEmpty 
import com.fasterxml.jackson.annotation.JsonProperty as jsonProperty 
import javax.validation.constraints.NotNull as notNull 
import javax.validation.Valid as valid 

我很期待:

import com.fasterxml.jackson.annotation.JsonProperty as jsonProperty 
import org.hibernate.validator.constraints.NotEmpty as notEmpty 
import kotlin.platform.platformStatic 
import java.text.DateFormat 
import javax.validation.constraints.NotNull as notNull 
import javax.validation.Valid as valid 

我使用的IntelliJ 14.0.2與科特林插件(0.10.195版本)

+13

你的觀察是正確的。此功能尚未實施:https://youtrack.jetbrains.com/issue/KT-4789 – yole

+1

根據YouTrack已解決此問題。 –

+0

@JaysonMinard似乎還沒有解決或我錯過了什麼? – miensol

回答

2

這已被固定在recent versions of IntelliJ,例如current version(在寫作時間2017.3.3)

如果您只有完整版IntelliJ 14的永久回退許可證 - 您仍然可以使用更新版本的社區版。