The orgional problem was that for some files the autocomplete would not complete things like “self” and “public” and if I would type self:: it would not show a list of functions.
The other problem was that for some files it would complete but not show functions of PHPUnit_Framework_TestCase when the class extends that so typing $th would complete to: “$this->” but the resulting list would not show assertEquals (which is a function of PHPUnit_Framework_TestCase).
Solved the first problem by changing:
throw(new Exception("Something wrong with the datastore",666));
to
throw new Exception("Something wrong with the datastore",666);
(taken the throw parameter out of it’s parentheses)
To add autocomplete for 3rd party libraries like phpunit do the following:
under project=>properties
=>php include path (list on the left)
=>libraries tab
=>add external source folder
=>added /usr/share/pear/PHPUnit/
For Eclipse to hint base class methods, the file containing that class must either be a part of current project, or linked to it. Navigate to Project -> Properties -> PHP Include Path; you can permanently add an external library / source folder to your project there.
As for Eclipse not hinting
selfand$this, are you sure you’re typing inside of a class method? Obviously, these words have no use anywhere else.