Is there a way to get a list of import suggestions in IntelliJ IDE? I'm looking for the equivalent of CTRL+SHIFT+O functionality from Eclipse, which automaticaly lists import suggestions.
Thanks!
I have tried the following according to this thread (Intellij IDEA CE 12 Android XML Code Completion not working): Go to File->Power Save Mode and disable it - it is off. Go to Preferences->Editor->Code Completion and check Autopopup code completion - this has been checked. Go to File->Invalidate Caches and restart.
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.
Select how IntelliJ IDEA should process references to missing classes and methods in pasted blocks of code: All: import statements will be added automatically for all missing classes and methods found in pasted blocks of code. Ask: IntelliJ IDEA will prompt you to select which classes and methods you want to import.
On my current machine (on Windows), it's Ctrl-Alt-O, and the command is named "Optimize imports".
In general, in IntelliJ IDEA, you can use Ctrl-Shift-A and press part of a command to find it and know the appropriate shortcut. Typing Ctrl-Shift-A (or if you're on a Mac ⌘-Shift-A) and then search for "import" allows finding this command easily.
That said, it seems this command doesn't suggest imports like Eclipse does.
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