18

My Eclipse doesn't use auto-complete... My colleague get a whole list of suggestions by just typing some letters and I get nothing...

The Eclipse version I use is:

Eclipse for PHP Developers

Version: Helios Service Release 2
Build id: 20110301-1815

(c) Copyright Eclipse contributors and others 2000, 2011.  All rights reserved.
Visit http://eclipse.org/ 

And I think I've set all available settings for autocomplete.
I lose a huge amount of time every time I have to search for the correct naming. Is there any module of software I've to install extra to get this autocompletion?

Michiel
  • 7,855
  • 16
  • 61
  • 113

9 Answers9

24

Ok, found the solution! Apparently I had to "Add PHP support" in the properties window of the project. Thanks for all the help though!

enter image description here

Michiel
  • 7,855
  • 16
  • 61
  • 113
  • Just a little addition here: I had to `Build Project` after enabling PHP support. And thanks for figuring this out, it's been bugging (hehe) me for weeks after a re-install. – Atari May 22 '15 at 09:56
  • in my case what worked for me was `Enable Zend Framework Support`. I did not have `Add PHP Support` in my drop down – Dennis Aug 22 '17 at 14:25
  • Mine said "Convert to PHP project", but yeah, this is the only thing that finally worked for me. – Richard Jun 22 '20 at 01:37
11

I did it by deleting ".metadata" directory on my main workspace :D

Nanang F. Rozi
  • 141
  • 1
  • 5
11

Generally this can be activated by enabling Content Assist. It can be found on Window-Preference->PHP->Editor->Content Assist

  1. Setup your php_include_path. Go to the properties of the project. Then PHP Include Path.
  2. If you have any external library add it there too (I use Zend and Kohana).
Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187
  • Right click on your project and click properties. On the left pane you should see *PHP Include Path*. See this image. http://tinypic.com/r/9kmtd1/5 – Shiplu Mokaddim Dec 20 '11 at 12:08
  • Thanks for the effort, but I don't have such a link in my properties... I found the solution though! – Michiel Dec 20 '11 at 12:43
3

I can try ALL answers (from this and others threads), only work for me delete (or rename for backup) .metadata folder on workspace folder

  1. Close eclipse
  2. mv .metadata .metadata_older
  3. Start eclipse (clean start wrokspace of eclipse, none project are listed)
  4. Import from workspace your project
  5. Eclipse rebuild and refresh works (several project settings are lost!!!)
  6. Autocompletion, follow code, etc now work.

This isn't the ideal solution, but is the ONLY solution for me, I migrated from eclipse 3.6 to 4.4 in one step, and PHP support is gone, only highlight code are working until delete .metadata folder.

Ubuntu 12.04 LTS 64 Java 1.7 ORACLE

Thanks.

prajmus
  • 3,171
  • 3
  • 31
  • 41
Claudiojd
  • 31
  • 1
2

Check the options in Windows preferences for content assist. It might be disabled. It probably would be php -> Editor -> Content Assist and see what is selected for auto activation.

0

If this happens only for one project in Eclipse and others are autocompleting correctly, it sometimes happen when you create new PHP project and press Finish on the first page.

To fix it, remove the project from Eclipse (Windows > Show view > Navigator and press DELETE on the project). Then go to project folder and delete file .project and folder .setting.

In Eclipse now select File > New > PHP project, select name and folder, press Next and verify (or manually add) that root folder of the project is listen on Source tab.

Then click Next and add root folder of the project or folders that contain PHP files into Build path. Now you can click Finish.

Note: adding Source and Build paths into existing project usually does not fix this problem and you really have to delete and create new project.

Radek Pech
  • 3,032
  • 1
  • 24
  • 29
0

Right click on the project -> Properties -> PHP -> Validation

Check the Enable prockect specific settings

Select PHP Ver

ido niger
  • 86
  • 2
  • 6
0

Check your .buildpath, try build something like this:

<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
    <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
    <buildpathentry kind="src" path="src"/>
    <buildpathentry kind="src" path="vendor"/>
    <buildpathentry external="true" kind="lib" path="common-libs/vendor/project-sample/lib"/>
</buildpath>
Rodrigo Guariento
  • 137
  • 1
  • 1
  • 13
  • Is this still an issue? I'm trying figure out when this happen, but I can not reproduce :( – zulus May 20 '20 at 21:23
  • If you're using Linux try change path="common-libs/vendor/project-sample/lib" by path="C:\common-libs\vendor\project-sample\lib", after that open your Eclipse. You will reproduce the problem. – Rodrigo Guariento May 25 '20 at 19:36
0

I don't use Eclipse, but I know in Netbeans (and other IDE's) you can type Ctrl + Space to bring up the auto complete window after you start typing a function/variable.

Give that a try.

fin1te
  • 4,289
  • 1
  • 19
  • 16