Eclipse: jQuery code completion
There are two ways of having the code completion in Eclipse.
The global way
This method involves adding the jQuery library to the project. You can do the same for every library you want (e.g. motools).
- Download jQuery.js files and put it somewhere outside of your project (just to have it only once for all projects)
- Click 'New' and name it 'jQuery' or whatever you like.
- Select this new 'jQuery' item and click 'Add .js file'.
- Select jQuery.js file.
- Click 'OK' and close the preferences.
You'll soon discover that's not so good because it doesn't work with $. or $().
The tailored better way
- Help→Install new software
- You'll see the JSDT jQuery plugin. Check and install it.
- Now open the project you want to feature the jQuery code completion.
- You'll see a new entry: 'jQuery library'. Select and click Finish.
- Now you can finally type $. and $() and you'll see the code completion
- In PHP Explorer view, right-click your project.