Creating Eclipse Templates

 

Lately a new project was launched on drupal.org, which purpose is to provide hook templates for the Eclipse IDE (http://drupal.org/project/eclipse). After installing the templates in Eclipse, I was very happy not to have to lookup the Drupal api pages for these hooks anymore. As soon as I began using these templates, I wished that I had such templates for non core hooks as well (the apachesolr module hooks for instance). Luckily, it is very easy to create these templates in Eclipse yourself.

First go to the edit template preferences in Eclipse.

Where you imported the drupal hooks using import, you can also create new ones here. Just copy some hook documentation (probably from a readme file) and paste it in the pattern field.

Now replace some text by variables (for instance hook by ${module_name}) and place the cursor at a logical position. Start the name with hook, give a sensible description and be sure the context is set to php. Click ok and you are done!

You can also create an xml export of the hooks you created. If you post this xml to the project page on drupal.org, I guess we get an excellent set of templates for Drupal!

Geplaatst in
|

Reactie toevoegen

CAPTCHA
Deze vraag wordt gebruikt om te testen of u een menselijke bezoeker bent teneinde spam-inzendingen te voorkomen.
Beeld-CAPTCHA
Enter the characters shown in the image.