Reputation: 39290
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/
Upvotes: 3
Views: 572
Reputation: 12342
Check your .buildpath
if all the folders with base classes and the classes you want to have autocomplete in are included there.
If you're including external libraries you can add them to the include path of your project.
Upvotes: 1
Reputation: 12776
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 self
and $this
, are you sure you're typing inside of a class method? Obviously, these words have no use anywhere else.
Upvotes: 2