I am a new user of IntelliJ IDEA 2016.2. I opened an existing project when I first ran the program and had the same issue whereby it only showed files in the root directory in the 1. Project panel, but not the project folders (expandable tree-like structure).
Initially, I tried going to Project Settings > Modules, where no modules were shown listed. I clicked (+), and tried to select my root folder, but it wouldn't select the folder.
So I then solved it with these steps instead:
- Exit IntelliJ
- Delete the existing .idea folder (i.e.
rm -rf .idea
)
- Restart IntelliJ
- Verified that the project root folder now appeared (in Project Settings > Modules)
- Toggle On the toolbar buttons (i.e. 1. Project Structure) to display on the left sidebar (clicked View > Toolbar Buttons until tick appears)
- Click 1. Project Structure toolbar button until its sidebar is revealed
- Click the arrow icon on the left of your project's root directory name that appears to expand the tree folder structure
UPDATE 2nd Sept 2017: If you've added a Module SDK and it added a .iml
file within a subdirectory of the root of your project that causes it to load the module subdirectory, then it may be necessary for you to modify that .iml
file by appending /..
as shown below.
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/..">
.idea
folder – Jun Yin