Reputation: 1007
My directory structure in the Project seems to have disappeared. The first picture is the "bad". I recently upgraded to 12.1 and the vim emulator at about the same time. I don't know if I missed a dialog that reset something? I can't figure out how to get it back like the second picture.
I've tried to re-import the project but it has not helped. I keep the project on Dropbox and have another PC where I have not reloaded project. Is there a way to get my view from that machine?
The picture is the "good" and how I want it to look.
Upvotes: 55
Views: 64830
Reputation: 416
Try following workarounds:
make sure IDE has permissions to access folders in System Settings | Privacy & Security | Files and Folders
another option is to move the project outside of Documents / Desktop / Downloads
folders
Upvotes: 0
Reputation: 1
In the bottom left corner of IntellIJ you'll find an icon, using which you can fetch project structure, etc..,
Upvotes: -1
Reputation: 620
This issue is 8 years old and the problem still exists in IntelliJ. For projects with many modules, it can be a real pain reconstructing them after each time this occurs. I suggest that once you reconstruct the modules, back up the .idea folder so you can easily restore it next time
Upvotes: 0
Reputation: 11
On Mac:
Preferences
search for Project Structure or go directly to:
Project: Your_Project_Name / Project Structure
Mark all as Sources (mine was marked as "Excluded")
Upvotes: 1
Reputation: 636
If you are working on a software development project where you are using Maven, Gradle, Flash Builder etc., the below mentioned steps should restore the project structure:
This resets your project structure.
Upvotes: 5
Reputation: 579
This is the quick fix that i have done:
To view the hidden folder and files:
Open the folder and press cntrl+H (in linux), And in windows Go to folder options and check view hidden files
option.
Upvotes: 0
Reputation: 335
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.
Upvotes: 4
Reputation: 2657
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.
Upvotes: 3
Reputation: 1565
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
Upvotes: 92
Reputation: 10370
If you have a content root for a project module that intersects with another content root, then this problem will occur. For example:
Project A (content root)
- source for A
- module B (content root)
- source for B
If you have a project that has a source root for "Project A" and you add a source root for "module B" you will end up with missing structure, such as your first picture. This happens because the content root for module B is within project A structure.
This worked at one time, as I have the setup above with multiple modules. When I upgraded to 12.1.6 this stopped working. If you have overlapping source roots you will see this problem.
I'm using 12.1.6 on windows 7.
Upvotes: 1
Reputation: 8216
You can sometimes rescue projects like these by going and resetting their content root in the module settings. Or even recreate the module as another answer suggests.
This is something that would happen to me if I opened an IntelliJ project in PhPStorm, then tried to open it in IntelliJ again.
However as was mentioned the project format changed recently, so you should use the same version of intelliJ to work on your project.
Upvotes: 2
Reputation: 8885
What did you update from? If you did a few major versions update, intellij really changed how their projects are laid out. You probably need to edit the projuct structure and add a new java module.
Upvotes: 0