Eclipse PDT + The completion of the code does not work at all

advertisements

I wanted to start a new Zend project, and currently I'm facing some issues regarding Eclipse PDT... My problem is, that the code completion in Eclipse for PHP does not work at all.

I tried a lot of different tutorials etc, for example making a new project and import the files; making a new workspace and import projects there; almost every possible combination of buildpath settings and library imports; deleting several files in .metadata (you will find lots of tutorials like this if you google for it), but nothing worked.

[Edit] Also the PHPNature is set (thanks to tranisstor):

<natures>
    <nature>org.eclipse.php.core.PHPNature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>

(It also does not work if there is only the PHPNature set, and no other in addition)

[/Edit]

The problem in detail: I made a new Zend project, and tried to start coding in the IndexController.indexAction(). First thing I did: I typed in $this->, but no code completion came... I thought maybe I would need to add the Zend library, which I did. When I click into the Zend_Controller_Action in class IndexController extends Zend_Controller_Action I can see the documentation of Zend_Controller_Action, I also can press F3 and the corrosponding file will appear... Which means, Zend is successfully added as library. I also tried Ctrl + Space, but just nothing happens. By the way, the standard PHP functions like isset() also won't show up in code completion

Does anybody have a idea how to fix this? I am using Eclipse Juno, with Eclipse PDT 3, and Zend Framework 1.x (don't know exactly, but it's not ZF2 and it works well if I open http://localhost.

I'm grateful for any help


I had the same problem when upgrading eclipse to Kepler. The following worked for me:

Remove files under workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2

The reason was that the workspace old DLTK index is not compliant with the new version and needs to be rebuilt. Start eclipse and the DLTK index will be regenerated.

Code completion worked for me again after that.