0

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?

mogilka
  • 135
  • 15
  • For PHP projects you must use "PHP Explorer". You can get some bad issues in "Project Explorer". You can open "PHP Explorer" from Window, Show View, Other, PHP, PHP Explorer menu. – kodmanyagha Nov 30 '16 at 15:29

5 Answers5

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.

Finding "Edit Working Set..." link

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.

Edit Working Set dialog

Linas Butenas
  • 161
  • 1
  • 7
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.

Andrei B
  • 2,740
  • 17
  • 12
  • thank for your reply. Now I'm using only Java working sets, but as you advice I'll try to create PHP working set and will check it if problem appears. – mogilka Jun 18 '14 at 09:44
  • About performance, Eclipse's is running slow even without working sets using, and it was always so. Sometimes IDE performance degrades because of JDK errors (under my Xubuntu). I put up with it because at the moment Eclipse is more convenient and stable for me, unlike other IDE. – mogilka Jun 18 '14 at 09:55
  • Now that I disabled working sets, it runs fine for me. Maybe because I feel it's fast due to the previous slowness :) The funny thing is that I ended up using working sets after reading it on a blog post with tips for speeding up Eclipse. – Andrei B Jun 18 '14 at 11:56
  • Andrei B, thank you very much, your advice works. Recently I added some new files to php project and all of them were invisible in PHP Explorer. I checked them in working set editor and now see them – mogilka Aug 21 '14 at 10:34
0
  • remove/rename the ghost folder from os/command line
  • create it from eclise
  • restore original files

OR

  • scratch metadata ...
quazardous
  • 846
  • 10
  • 15
0

click refresh link after select project should reload project and all files/folders will show up.

fearless
  • 11
  • 1
0

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.

Abir Pathak
  • 129
  • 1
  • 4