Intellij IDEA code hints do not work

I recently started practicing in Java and after playing around a little bit with SublimeText I decided to try out the full featured IDE and installed the latest Intellij IDEA.

So I got it installed, created a new project, added JDK and pointed to my existent folder with java files like this:
java-study

I expected that IDEA will automatically give code hints for imports and function calls but it didn’t worked. Whenever I used import I got this:
import

And whenever I tried invoking code suggestions I got this:
codehint

I couldn’t figure out what’s wrong but finally I noticed the “src” folder and tried to move my files there:
java-study2

Now everything worked fine:
codehint2

It turned out in Java world it’s common to separate the sources and the other types of files like resources, config-files and compiled files. If you press Ctrl+Alt+Shift+S you’ll get the project settings window where you can configure your custom sources folder but it defaults to “src” as you can see:
sources

It was a a little bit unusual for me as my favorite PHP editor (Nusphere) by default parses the whole project folder and makes code-hints available from everywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.