Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folders missing in project pane in Webstorm

Tags:

ide

webstorm

I've built a project in WebStorm and then submitted the project to GitHub.

When I rebooted the computer and relaunched WebStorm (and the project), all I can see in the project pane is the root files, and none of the folders (yes the folders are there)

See the image below for reference.

Does anyone know how I can get those folders to re-appear in the project pane of Webstorm?

enter image description here

like image 982
Chase Florell Avatar asked Feb 15 '12 22:02

Chase Florell


People also ask

Why project structure is not showing in IntelliJ?

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)

How do I add files to a WebStorm project?

tip. You can also add files to your local repository from the Project tool window. Select the files you want to add, and press Ctrl+Alt+A or choose VCS | <your_VCS> | Add from the context menu.


9 Answers

It can be caused by the corrupted .idea/modules.xml project file. You can either try to fix it manually (restore from Local History, version control or backup) or create the new project from scratch.

Check this issue for the hints/workarounds.

like image 166
CrazyCoder Avatar answered Nov 10 '22 01:11

CrazyCoder


It happens sometimes in WebStorm 9. The easiest way to fix it for me:

  1. close WebStorm;
  2. in project's folder remove .idea/ (hidden directory);
  3. open your project, enjoy:)
like image 31
Alexa Avatar answered Nov 09 '22 23:11

Alexa


Solution:


Creating a new project from existing sources

  1. File => New => Project
  2. Select "Empty Project"
  3. Browse to the location of your project with folder issues
  4. Click "Create"
  5. Select "Create from Existing Sources" in the "Directory Is Not Empty" dialog

Why this solution:


Editing and deleting in various combinations of .idea and XML files did not solve the issue for me. Hence the solution above. Back up your .idea directory in case you have project customizations you want to keep. This likely overwrites them.

Outcome:


All the various folders I had created were now visible and the project worked as expected. The .idea directory was now formatted correctly with all the necessary files.

like image 31
King Holly Avatar answered Nov 10 '22 00:11

King Holly


Find the .idea/modules.xml in your project root make sure that these lines are correct :

<modules>
  <module fileurl="file://$PROJECT_DIR$/.idea/NameOfYourProject.iml" filepath="$PROJECT_DIR$/.idea/NameOfYourProject.iml" />
</modules>

Replace NameOfYourProject.iml with the name of your project.

Then, make sure that the file .idea/NameOfYourProject.iml exists, if not , create it and put this in it :

<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
  <component name="NewModuleRootManager">
    <content url="file://$MODULE_DIR$" />
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="module-library">
      <library name="PHP">
        <CLASSES>
          <root url="file://$MODULE_DIR$/../../php/PEAR" />
        </CLASSES>
        <SOURCES />
      </library>
    </orderEntry>
  </component>
</module>
like image 41
Alex Beauchemin Avatar answered Nov 10 '22 00:11

Alex Beauchemin


You do not need to delete whole .idea folder and reconfigure your whole project, just

  1. delete the .idea/modules.xml
  2. restart the IDE and your folders are there again!
like image 33
Sebastian Viereck Avatar answered Nov 10 '22 00:11

Sebastian Viereck


I ran into the same issue and resolved it by invalidating the cache. The option is under File > Invalidate Caches/Restart. On the prompt click Invalidate and restart.

Note: The project in concern needs to be open before you do this.

like image 31
Randeep Avatar answered Nov 09 '22 23:11

Randeep


I see this from time to time. I use Git, and I have my .gitignore file set up as recommended, specifically:

.idea/workspace.xml
.idea/tasks.xml
.idea/*.iml

I sometimes see this after cloning the repository, and when trying to figure out why, I came across this post and read the accepted answer.

I deleted the modules.xml file and reopened WebStorm (2016.2.4), and it was resolved. I looked at the new modules.xml and found that its contents were exactly the same as before, but my <projectName>.iml file was bigger.

So it seems to be a corruption in the .iml file, not modules.xml. I assume that deleting modules.xml triggers a rebuild of the .iml file. Not sure if this helps anyone with anything, but thought I would offer the extra insight.

like image 36
Travesty3 Avatar answered Nov 10 '22 01:11

Travesty3


floor 36 solve my problem. in WebStrorm 11

It happens sometimes in WebStorm 9. The easiest way to fix it for me:

  1. close WebStorm;
  2. in project's folder remove .idea/ (hidden directory);
  3. open your project, enjoy:)
like image 27
Zgpeace Avatar answered Nov 09 '22 23:11

Zgpeace


Try deleting workspace.xml and watchertask.xml then just restart the IDE. You must see your full source code in all folders there.

like image 39
Rajesh Mbm Avatar answered Nov 09 '22 23:11

Rajesh Mbm