https://kotlinlang.org logo
#stdlib
Title
# stdlib
k

Klitos Kyriacou

07/05/2022, 4:32 PM
Wouldn't it be nice if package kotlin.io.path was included in the list of default imports? It includes many functions that are preferable to those with the same names in the kotlin.io package. One consequence of it not being included is that, for example, if you start writing "createT", IntelliJ IDEA offers to complete it to "createTempFile" from kotlin.io which is deprecated in favour of kotlin.io.path.createTempFile due to security concerns. But you won't even see the option to choose the latter in the list of suggested completions.
👎 2
👍 2
s

Starr

07/05/2022, 4:58 PM
that sounds more like an IJ bug/enhancement than a change in the language/stdlib
n

nkiesel

07/05/2022, 7:54 PM
This list of default imports is part of the language, and I agree that - given that koltin.io.* is part of that list - adding kotlin.io.path.* makes sense to me.
j

Javier

07/06/2022, 11:54 AM
An official io (finished) library with default imports should be great, when scripting without IDE autocompletion it is annoying to add java imports and so on, which is pretty usual using files in scripts
2 Views