IntelliJ does not sort Kotlin imports

When writing Java code, IntelliJ automatically sorts the import by name. However, when members are imported into Kotlin, they remain unsorted. Code Selection → Optimize Import ( Ctrl + Alt + O ) does nothing.

Here is an example:

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 

What I expect:

 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 

I am using IntelliJ 14.0.2 with the Kotlin plugin (version 0.10.195)

+7
intellij-idea intellij-14 kotlin
source share
1 answer

This has been fixed in recent IntelliJ versions , for example the current version (at the time of writing 2017.3.3)

If you only have a perpetual backup license for the full version of IntelliJ 14, you can still use the community version of a later version.

+2
source share

All Articles