Eclipse autocomplete is not working for PHP-project

前端 未结 9 2252
眼角桃花
眼角桃花 2021-02-18 23:17

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:

相关标签:
9条回答
  • 2021-02-18 23:33

    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

    0 讨论(0)
  • 2021-02-18 23:39

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

    Check the Enable prockect specific settings

    Select PHP Ver

    0 讨论(0)
  • 2021-02-18 23:40

    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.

    0 讨论(0)
  • 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 讨论(0)
  • 2021-02-18 23:44

    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.

    0 讨论(0)
  • 2021-02-18 23:49

    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.

    0 讨论(0)
提交回复
热议问题