-
-
Notifications
You must be signed in to change notification settings - Fork 24
Code Templates
pulse00 edited this page Dec 6, 2011
·
2 revisions
You can contribute eclipse code templates by adding them to the file
A template is an XML node in the form
<template
name="templateName"
description="%CodeTemplates.descriptionString"
id="org.eclipse.twig.ui.editor.templates.function.templateID"
context="twig"
enabled="true"
autoinsert="false">%template.templateCode
</template>
Where %CodeTemplates.descriptionString
(the description in the UI) and %template.templateCode
(the actual code template) are unique externalized strings. They reference the internationalization file in
The line
template.templateCode={% for ${item} in ${items} %}\n ${cursor}\n{% endfor %}
will produce
{% for item in items %}
{% endfor %}
where item and items are 2 parameters which will be "tabbable" code blocks. After the 2 params have been altered, the curser will be in the position of ${cursor}.