diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm
index 1c70c3cacdc..2587fead256 100644
--- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm
+++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm
@@ -41,23 +41,23 @@ You trigger the Code completion feature when you call Content Assist (such as wh
You can view the signature of each item on the list in a pop-up by pointing to it. You can then select an item in the list to insert it directly into your code.
-
Code templates
+
Templates
-
You can create and save code templates for frequently used sections of code, which will be inserted according to scope. The Content Assist feature also provides quick access to code
+
You can create and save templates for frequently used sections of code, which will be inserted according to scope. The Content Assist feature also provides quick access to code
templates.
When you enter a letter combination in the C/C++ editor, and type CTRL+SPACE (or right-click and click Content Assist), a
-list of code elements and code templates that start with the letter combination that you typed is displayed.
+list of code elements and templates that start with the letter combination that you typed is displayed.
-
You can then select a code template from the list and it is inserted directly into your code.
+
You can then select a template from the list and it is inserted directly into your code.
-
For example, the code template do while statement contains the following code:
+
For example, the template do while statement contains the following code:
-
When you select the do code template from the list, you insert the following code:
+
When you select the do template from the list, you insert the following code:
diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_templates.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_templates.htm
index 10d8606660a..f9467cce697 100644
--- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_templates.htm
+++ b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_templates.htm
@@ -28,9 +28,9 @@ The templates that begin with that character appear. Double-click on a template
The code templates page contains templates that are used by actions that generate code and/or source files.
+E.g. the New Class wizard uses source and header file templates to create new files and code templates to insert generated method stubs.
+Templates contain variables that are substituted when the template is applied. Some variables are available in all templates, some are specific to templates.
+
+
+
+
Action
+
+
+
Description
+
+
+
+
+
+
+
New...
+
+
+
Opens the Code Template dialog to create a new file template.
+
+
+
+
+
Edit...
+
+
+
Opens the Code Template dialog to edit the currently selected code template.
+
+
+
+
+
Remove
+
+
+
Removes a user added file template. Predefined templates cannot be removed.
+
+
+
+
+
Import...
+
+
+
Imports templates from the file system.
+
+
+
+
+
Export...
+
+
+
Exports all selected templates to the file system.
+
+
+
+
+
Export All...
+
+
+
Exports all templates to the file system.
+
+
+
+
+
+
+
Comment Templates
+
+
+
+
+
+
Template Name
+
+
+
Specifies
+
+
+
+
+
+
+
Files
+
+
+
Header comment for new source or header files.
+
Note that this template can be referenced in source and header file templates with ${filecomment}.
+
+
+
+
+
Types
+
+
+
The comment for new types.
+
Note that this template can be referenced in source and header file templates with ${typecomment}.
+
+
+
+
+
Fields
+
+
+
The comment for new fields.
+
+
+
+
+
Constructors
+
+
+
The comment for new constructors.
+
+
+
+
+
Destructors
+
+
+
The comment for new destructors.
+
+
+
+
+
Methods
+
+
+
The comment for new methods.
+
+
+
+
+
+
Code Templates
+
+
+
+
+
+
Template Name
+
+
+
Description
+
+
+
+
+
+
+
Method body
+
+
+
The 'Method body' templates are used when new method is created.
+
+
+
+
+
Constructor body
+
+
+
The 'Constructor body' templates are used when a constructor is created.
+
+
+
+
+
Destructor body
+
+
+
The 'Destructor body' templates are used when the destructor is created.
+
+
+
+
+
File Templates
+File templates can not only be defined and modified for C/C++ files, but also for other content types, like Assembly files or plain text files.
+The New File from Template wizard can be used to create new files based on one of the templates defined in this page.
+
+
+
+
+
+
Template Name
+
+
+
Description
+
+
+
+
+
+
+
Default C++ source template
+
+
+
Used by the New Class wizard and the New Source File wizard when a new C++ source file is created.
+
The template can specify where comments are added. Note that the template can contain the variable ${typecomment} and ${filecomment} that will be substituted by the evaluation of the Types respectively Files comment template.
+
+
+
+
+
Default C++ header template
+
+
+
Used by the New Class wizard and the New Header File wizard when a new C++ header file is created.
+
The template can specify where comments are added. Note that the template can contain the variable ${typecomment} and ${filecomment} that will be substituted by the evaluation of the Types respectively Files comment template.
+
+
+
+
+
Default C source template
+
+
+
Used by the New Source File wizard when a new C source file is created.
+
The template can specify where comments are added. Note that the template can contain the variable ${typecomment} and ${filecomment} that will be substituted by the evaluation of the Types respectively Files comment template.
+
+
+
+
+
Default C header template
+
+
+
Used by the New Header File wizard when a new C source file is created.
+
The template can specify where comments are added. Note that the template can contain the variable ${typecomment} and ${filecomment} that will be substituted by the evaluation of the Types respectively Files comment template.
+
+
+
+
+
Other file templates
+
+
+
File templates can be defined for other content types, e.g. Assembly or plain text.
+
+
+
+
+
+
Edit Template dialog
+
+
The following fields and buttons appear in the dialog:
+
+
+
+
+
Action
+
+
+
Description
+
+
+
+
+
+
+
Name
+
+
+
The name of the template. Only available for file templates.
+
+
+
+
+
Type
+
+
+
The file type (content type) of the template. Only available for file templates.
+
+
+
+
+
Description
+
+
+
A description of the template
+
+
+
+
+
Pattern
+
+
+
The template pattern.
+
+
+
+
+
Insert Variables...
+
+
+
Displays a list of pre-defined template specific variables.
Use the Templates preference panel to manipulate any of the common code templates predefined within CDT or create your own. To modify, delete, export,
+
Use the Templates preference panel to manipulate any of the common templates predefined within CDT or create your own. To modify, delete, export,
import, or create your own templates click Window > Preferences > C/C++ > Templates.
@@ -23,15 +23,15 @@ import, or create your own templates click Window > Preferences > C/C++
New...
-
Opens the New Template dialog to create a new code template.
+
Opens the New Template dialog to create a new template.
Edit...
-
Opens the Edit Template dialog to edit the selected code template.
+
Opens the Edit Template dialog to edit the selected template.
Remove
-
Removes the selected code templates from the list.
+
Removes the selected templates from the list.
Restore Removed
@@ -43,15 +43,15 @@ import, or create your own templates click Window > Preferences > C/C++
Import...
-
Imports a code template.
+
Imports a template.
Export...
-
Exports the selected code templates.
+
Exports the selected templates.
Use code formatter
-
Enable to apply the currently selected code style to the code template.
+
Enable to apply the currently selected code style to the template.
Use Content Assist to insert C/C++ elements of your project, and code templates into your code. You can insert a code template into your source code rather than retyping
+
Use Content Assist to insert C/C++ elements of your project, and templates into your code. You can insert a template into your source code rather than retyping
commonly-used snippets of code.
-
To insert a code template or element:
+
To insert a template or element:
-
In the C/C++ editor, type at least the first letter of a code template or
+
In the C/C++ editor, type at least the first letter of a template or
element then Ctrl+Space.
- A list displays the code templates
+ A list displays the templates
followed by the elements that start with the letter combination you typed.
@@ -63,8 +63,8 @@ commonly-used snippets of code.
Content Assist
Click OK.
- The code template list is updated to include the template that you imported.
+ The template list is updated to include the template that you imported.
-
To export a code template
+
To export a template
Click Window > Preferences.
-
Expand C/C++, and click Code Templates.
-
Select the templates that you want to export and click the Export... or Export All... button. The Exporting x dialog opens where x is the number of code templates that you are exporting.
-
In File name box, type the path where you want your code templates file to be saved.
+
Expand C/C++, expand Editor and click Templates.
+
Select the templates that you want to export and click the Export... button. The Export Templates dialog opens.
+
In File name box, type the path where you want your templates file to be saved.
Click Save.
- The templates.xml file containing the code templates you exported is saved in your file system.
+ The templates.xml file containing the templates you exported is saved in your file system.