cbeust / kash

A shell powered by Kotlin
296 stars 15 forks source link

extend Kotlin default imports #8

Open linux-china opened 5 years ago

linux-china commented 5 years ago

The Followings are default Imports of Kotlin, could the use add more global imports for kash.

kotlin.*
kotlin.annotation.*
kotlin.collections.*
kotlin.comparisons.* (since 1.1)
kotlin.io.*
kotlin.ranges.*
kotlin.sequences.*
kotlin.text.*

For example if you use kclock in kash:

// good 
val now = DateTime.now()
//bad
val com.soywiz.korlibs.klock:klock-jvm.DateTime.now()

too much code for package name, and nobody can remember the package name.

With global imports introduced, and I can add "com.soywiz.korlibs.klock:klock-jvm" in global imports, and use DateTime directly.

cbeust commented 5 years ago

Yes, take a look at the TODO and you'll see I have import management listed there.