# Support for Templates

Templates provide more sophisticated and configurable completion. Consult the [Xtext documentation](https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#templates) and the [Eclipse documentation](http://help.eclipse.org/luna/topic/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm) for reference. 

Currently, it is best to create and test templates within Eclipse with the installed TOP components. Once the templates are tested and validated, all templates shall be exported and the exported file shall be placed in the templates folder. As the exported file does not include the required IDs, these need to be added. The ID generator can help with that.

Currently, only the brace-based textual syntax is supported. The indentation-based and legacy syntax notations may be supported in the future as well. The goal shall be to reuse the templates as far as possible, at least between the indentaiton-based and brace-based syntaxes. Using the Xtext-specific extensions shall make that possible, albeit making the template specification a bit more challenging due to the use of corresponding context types instead of plain keywords / syntax elements.