I am a newcomer finding my way around the IntelliJ IDE, for which I am currently using for coding in Scala.
Right clicking in the Project window brings up a pop-up, with "Mark Directory As ..." as an option, with the following choices:
Lets go through the options:
src/main/scala(though you can change that, or add extra source directories in your build). Directories nested below this level should be packages. Intellij needs to know these are sources so it can highlight them, check them for errors, etc.
If you're using SBT you might not have to use "Mark directory as..." manually much at all, since the Intellij SBT plugin has grown smarter about inferring source, resources, and generated source directories automatically from the
It's worth noting that Intellij plugins can add additional options to the "Mark directory as..." menu - for example, the Python plugin has a "Template Folder" option.