user971169
user971169

Reputation: 110

eclipse organize import not working with kotlin files

When I try to use the organize inputs in a Kotlin class, it does not add missing imports like in Java.

Specific case:

  1. create a new Kotlin class file with the following contents: data class Foo ( public var fileEncoding: String = StandardCharsets.UTF_8.name() )
  2. Eclipse complains that it can't find StandardCharsets
  3. use organize inputs, but StandardCharsets is not added to the import statements.

I would have expected that it added the line import java.nio.charset.StandardCharsets

Upvotes: 1

Views: 977

Answers (1)

Mikhail Zarechenskii
Mikhail Zarechenskii

Reputation: 311

Update: since 0.7.0 Kotlin Eclipse plugin supports organize imports.

At present, Kotlin Eclipse plugin does not support "Organize imports" feature: KT-3962. Please feel free to upvote for this issue.

For now, you can try to invoke quick fix action (Ctrl+1) to import StandardCharsets class.

Upvotes: 3

Related Questions