Follow this Blog!

Dec 20, 2016

f Comment

[SOLVED] Fix Eclipse PHP Control+Click Not Working Problem in SECONDS!

Amazon If you use Eclipse for PHP Developers, you want to be able to navigate through code quickly by control clicking on, say, a function call and be taken to the function definition immediately. For example, in SiteController.php here is a line of code:
ControllerHelper::renderHomepage($this);
You hold down Control key and left click your mouse somewhere at the word "renderHomepage". Your cursor changes to a hand and the word "renderHomepage" changes itself to a link, suggesting you to click. And when you do, you are taken to the following place in ControllerHelper.php:
public static function renderHomepage($controller){
...
}
This feature is part of the content assist function. Isn't life beautiful? But what if your Eclipse does not navigate like this? Simple. Follow the following easy steps to enable the content assist feature of Eclipse PHP Development Tools (PDT).

Delete DLTK index.

1. Close Eclipse.

2. Delete the org.eclipse.dltk.core.index.sql.h2 folder in .metadata/.plugins of your workspace. This will delete the dynamic language toolkit databases (those are used in ctrl+click or F3 search).

3. Open Eclipse again. The DLTK databases will be recreated.

Add PHP support to your root folder.

In PHP explorer, find the root folder and right click your mouse at the root folder. Then select Configure -> Add PHP Support...

Here's a screenshot:

Add PHP Support to a Project in Eclipse

That's it! You don't need to restart Eclipse. Questions? Let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
Find Michael on Google or Facebook
ADVERTISING WITH US - Direct your advertising requests to Michael