in java i have star import disabled and it works correctly. but in kotlin when i import UUID it adds
import java.util.*
instead of import java.util.UUID
. there is no <alt>+enter
option to change it, i see no option in settings to change it. any idea how to change this behavior?
IntelliJ IDEA 2017.3.4 (Community Edition) Build #IC-173.4548.28, built on January 30, 2018
Disable wildcard importsIn the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Code Style | Java | Imports. Make sure that the Use single class import option is enabled.
You can disable auto-import on completion and use quick-fixes instead: In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | General | Auto Import. On the Auto Import page that opens, use the checkboxes in the TypeScript/JavaScript area to enable or disable import generation on code completion.
5 Answers. Show activity on this post. Disable File | Settings | Editor | General | Auto Import | Optimize imports on the fly. Normally you don't need to add imports manually, IDEA does it for you.
In Eclipse, you press CTRL + SHIFT + O “Organize Imports” to import packages automatically. For IntelliJ IDEA, if you press CTRL + ALT + O “Optimize Imports”, it just removes some unused imports, never imports any package.
You can configure this in the settings. Go to Editor -> Code Style -> Kotlin -> Imports in the preferences dialog. The java.util
package is probably listed in Packages to Use Import with '*'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With