问题
I use PHP Development Tools in Eclipse IDE. I did refactoring and move some scripts to the new folders of PHP project. Now no refactored folders or files are displayed in PHP Explorer View although they are present in the file system.
The problem occurs regularly after moving or renaming files. I sent bug report to Eclipse technical support but so far they have not solved it.
There is radical solution - to re-create the workspace, but then it's too expensive restore all my settings, reimport all projects, restore all working sets, etc.
All described above causes a lot of discomfort in my development work. So I decided to try to resolve it myself, because there is the only Eclipse workspace and a bug can be hidden within it.
I make a simple search on the file system and found three files that mention the name of my PHP project:
- workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/model.h2.db
- workspace/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
- workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Removing sqlite database yielded nothing - after restarting Eclipse recovered db file, but I didn't saw my files in new location.
Then I deleted workingsets.xml file and restarted Eclipse - and lo! My files and folders now appear in the PHP explorer. But the truth is that all my working sets also deleted... In any case it's better than to remove and restore the whole workspace. Although using of working sets is very important for me - I work with a lot of different projects on PHP and Java, and I love when they all are classified.
I don't really go into the heart of the problem, but it seems that Eclipse can't work with the PHP projects correctly when they are placed in the working sets. I think it is a bug in this.
Wait and see how things will work on. But maybe anybody has a solution?
回答1:
For me this happened multiple times, on different project and different folders. Opening+closing or refreshing the project yield no success.
In my case, I have found out that this is related to the Working sets. It seems by default new subfolders and files of a project are not marked belonging to the set, so the project has a mix of old folders (included) and new folders (excluded).
To fix this, you can disable the working sets or edit the active working set and check the project's checkbox (which will check all subfolders).
Bonus tip: on large projects, having this mixed state working set made opening the folder structure (and other operations) very slow (3-5 seconds per level). Turning off the working set filter made it instantaneous.
回答2:
If you are using a Working Set, try the following (it helped me)
Go to the Edit Active Working Set... (under PHP Explorers "View Menu" - a small triangle, between the Link With Editor button, and Minimize button.
Then an Edit Working Set dialog opens, go to your Project and look if all the files are included in EACH of the folders. You will see that some folders include not all files. Select the files you want to see.
回答3:
- remove/rename the ghost folder from os/command line
- create it from eclise
- restore original files
OR
- scratch metadata ...
回答4:
click refresh link after select project should reload project and all files/folders will show up.
回答5:
I was facing a similar problem. Some of my folders weren't visible in project explorer. Directory structure:
-libs
--somelibfolder
---some_php_file.php (Not a class just a simple file)
Changing this setting fixed this:
- Go to project explorer drop down arrow and click on "Customize View..."
- Here you'll see a list of items if checked means they'll be hidden. So, uncheck "Empty parent packages"
Then my folders were visible again. Don't know why eclipse was hiding the folder. It didn't have a class file in it. Just a simple php file. So probably being taken as an empty package folder.
Hope this helps.
来源:https://stackoverflow.com/questions/22405451/folders-and-files-dont-appear-in-php-explorer-in-eclipse-ide