Intellij IDEA Project view doesn't show structure as it did before.

I've come across this problem a few times myself. What happened is that intellij lost the module in my project settings. Here's my steps to fix it:

File -> Project Structure -> Click on modules (notice empty list) -> Click on '+' -> Click on import module -> Find existing myProj.iml


I also have quite a few IntelliJ projects and also git folders of text files. I found IntelliJ does not always reconstruct the .idea files correctly. However the following methods work for me.

  • Open IntelliJ in the top folder where there is no .idea folder. Often IntelliJ will just construct a new .idea folder and works.
  • Copy an .idea folder from a similar project and modify to fit. The xml files in the .idea are reasonable to modify.

  • Open IntelliJ in the root project level works for me.

    I have a mixed project folder tree like the following:

    git_root
    - proj_android
    - proj_ios
    - proj_react
      - lib
      - src
    

    My problem is that when I open IntelliJ on my proj_react folder, I could not see my src folder or lib folder. (My proj_react is one level down from my git_root.)

    Then I open IntelliJ on git_root, I could see everything. The problem is solved.