http://drupal.org/node/75242
Download Eclipse PDT version
then
necessary st
Eclipse Hook Templates
A collection of very handy Drupal hook templates is available for Eclipse. These are great for quickly inserting many common Drupal hook functions for both Drupal 6 and 7.
- Download the templates from the Eclipse Hook Templates project page.
- In Eclipse, go to Preferences > PHP > Editor > Templates and 'Import' the downloaded XML file. Apply your changes.
- Use the templates by typing the name of the hook (eg. 'hook_form') and pressing ctrl-space to pop up the auto-complete window.
PHP Development Tools (PDT) (package)
This is the official Eclipse project developed by Zend at http://www.eclipse.org/pdt/.
- Make sure Drupal file types are recognized as PHP files:
For PDT version 2.1.1: Under Window -> Preferences (Eclipse
-> Preferences on Mac) menu:- Expand the left-hand menu to General -> Content Types. Under Content types on the right, click Text -> PHP Content Type. Add the
*.engine, *.theme, *.install, *.inc, *.module *.profile
and*.test
file types so that these files will be recognized as PHP. The free plug-in to Eclipse for Drupal developers does this for you and is easy to install.
- Expand the left-hand menu to General -> Content Types. Under Content types on the right, click Text -> PHP Content Type. Add the
- Make sure the file encoding and characters are Unix friendly so that any code can be committed back in to the Drupal repositories (if you are so inclined):
For PDT version 2.1.1: Under Window -> Preferences (Eclipse
-> Preferences on Mac) menu: - Ensure that spaces are used instead of tabs:
For PDT version 2.1.1: Under Window -> Preferences (Eclipse
-> Preferences on Mac) menu: