Project view not showing directories
Somehow the Project view is not showing the directories for my Project? It's as though it's treating the build.xml as the 'root' of the project and I'm not able to browse directories as I usually can. I've tried invalidating the caches and restarting, no help. Problem is not present for any of my other projects.
Attachment(s):
Screen shot 2011-12-20 at 11.22.52.png
请先登录再写评论。
I think I found a simple solution that seems to work for me in PHPStorm. Yes, you can switch to the "Project Files" view, but that does not solve the problem of namespaces not being properly detected and "class not found" inspections in the IDE. I tried invalidating the cache and restarting but that did not seem to help. I did not want to delete the .idea directory. On a whim, I tried closing the project via the "File-->Close Project" menu and re-opening it. This worked for me after all other methods failed. I didn't even have to restart the IDE. So, apparently manually closing and re-opening the project without restarting the IDE does something different than simply closing the window and restarting the IDE.
Switch to "Project Files" view instead of "Project" view. Done.!!!
What worked for me is that I closed the project from the "File" menu, then delete the .idea/ folder from command line and then open the project again.
Check your idea.log -- it may have some details explaining why or what is happening (Help | Reveal log in Explorer). Possibly one of the config files got corrupted.
You can always backup and delete .idea subfolder (project settings) and re-create project from scratch. When it's wroking again (after basic configuration) you may copy some of the files from that folder back to recover some of your settings (if there were many).
Thanks, I didn't have to many settings, and deleting .idea then recreating the project has solved the problem.
Switch to "Project Files" view instead of "Project" view
Worked for this newb
So, I see what is gong wrong, and I now have a good understanding why. The problem is that the .idea folder is best not committed to git/version-control as it differs per developer/system. My tip to all is to ignore the folder, but more importantly untrack the folder as well. Switching to branches which still have this folder tracked, can bring problems as you will be switching .idea folder to other developers and older states (losing for example run configurations).
(I think my problem still arises for because my master branch still contains the .idea folder, so I have to release/PR to master to untrack it and it will be fixed.)
How to fix it:
1) Add .idea or **/.idea to .gitignore
2) And untrack the folder (adjust the path to your situation). Make sure to commit/push and PR/merge/release the result to any afflicted branches.
The issue still persists for me using WebStorm.
Here's a list of proposed solutions from this thread that don't work for me:
The only thing that works is to delete the .idea/ folder and start fresh.
WebStorm 2021.1.2
Build #WS-211.7442.26, built on May 24, 2021
Runtime version: 11.0.11+9-b1341.57 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
Further to this, the Project preferences for Directories won't load to show which directory the project points to. See attached.
Attachment(s):
Screen shot 2011-12-20 at 11.40.01 (2).png
Thanks, deleting the .idea directory worked for me. After that all the folder showed up again.
@Leo
No idea. That delete option was offered as hard workaround for one time issue.
If it happens to you all the time.. then it must be something else and needs investigation. Contact Support Team by making Support Request -- use "Submit a Request" link at the top of this page.
To view all folders in explorer project view...
File -> Settings
Version Control -> Directories
Add content root to project root folder. All folders will appear in project
Issue still persists in PHPStorm 2020.2.
No directories found, Settings > Directories is empty ("nothing to show").
Deleting the .idea/workspace.xml file did the job for me. The re-created workspace.xml did not show any significant differences - however, re-creating the file also created a .idea/<project>.iml file which was missing before. So I suppose that's might be the core of the problem. Also, the inspectionProfiles folder was created after that, but I suppose that is just because previously my source folders were not available for indexing.
@..., thank you! Your simple solution helped me! For me - the same issue appears in my IntelliJ IDEA Ultimate 2020.3.
@D J Zwart
You can share the .idea in VCS if that makes sense/brings benefits for your team. Just not the whole folder: some dev-specific files need to be excluded. Check the link below for some general info:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Is that it? No way to force reindex the project folder ... so every time I add a new folder I have to close the project, delete .idea then open the project again ??
Thanks, deleting the .idea directory worked for me too.
You're definitely right, Brett. Thank you!)
@...'s solution worked for me as well! Thank you.
I had this issue with two projects. Neither Oliver's nor Brett's solution didn't work in my case. Invalidating the caches and restarting did not work, either. Deleting the `.idea` directory fixed the issue on the first project, but found a simpler solution with the second one:
Vireyes14
Thank you, that worked for me unlike other solutions
What worked for me:
1. Close project
2. Then delete whole .idea directory
3. Open project again
Now Webstorm shows me file in Project correctly. Thanks everyone for help!
File -> Settings
"Project Structure" under Project
On the right hand side you will see all your projects
Now select the hidden project, then "Add Content Root"
Select the root folder of your project
Save
All projects should now appear properly
I had a browse around settings when this happens. Most frequently it happens when I load the same project up in different jetbrains tools (pycharm, clion, intellij etc) which is common for me as I do a lot of mixed work on the same repo.
I noticed that when my files vanish from the "Project" view that it appears the IDE thinks the project has no root folders.
If I go into the Settings -> Project -> Project Structure dialog, sure enough there are no roots. If I set my root folder back up as normal things start working again.
Looking at the files that change between having no root and adding it back. The project ".iml" file has one difference:
Broken projects seem to be missing the `<content url="file://$MODULE_DIR$" />` element from <component>
Though, sorry, I didn't check the log before I deleted it... :( If it happens again I will do and report back findings if that would help.
http://youtrack.jetbrains.net/issue/WI-8962?projectKey=WI
http://youtrack.jetbrains.net/issue/WI-8962?projectKey=WI
If you still facing this issue, check that your path to the project doesn't contain special characters. Because in my case, there was a folder "\...more!\" and in Settings>Directories content root was "\...more\!\".
Banehallow unless spaces are considered special characters, this cannot be the reason in my case.
@... got it right, that's the most simple workaround. However, this is only a workaround and still a bug that should be addressed.
@... you're lifesaver, man!