Using Content Assist
Use Content Assist to insert C/C++ elements of your project or referenced project(s),
and code templates into your code. You can insert a code template into your source code rather than retyping
commonly-used snippets of code.
To insert a code template or element:
- In the C/C++ editor, type at least the first letter of a code template or
element.
- Click Edit > Content Assist.
A list displays the code templates
followed by the elements, in
alphabetical order, that start with the letter combination
you typed.
- Do one of the following:
- Continue typing. The list shortens. When there is only one item in the
list, it is automatically inserted.
- Double-click an item in the list to insert it into your code.
- Press Esc to close the Content Assist Window.
To set Content Assist preferences:
- Click Window > Preferences.
- Expand C/C++, and clickC/C++ Editor.
- Click the Content Assist tab.
- Do the following:
- To insert an element when you open Content Assist and it is the only
item
in the list, select the Insert single proposals automatically check
box.
- To automatically open Content Assist when you type the first letter of an
element for which there is a match, select the Enable auto activation.
- To turn on Content Assist after a given number of seconds, type a value
in the Auto activation delay box.
- To specify a character that, if typed in the C/C++ editor, causes code
assist to be invoked immediately before the delay times out, type a
trigger in the Auto activation triggers for C: box.
- To change the background color of the Content Assist dialog box, click
the color palette button.
- Click OK.
Content Assist
Creating and editing code templates
Importing and exporting code templates
Content Assist page, Preferences window
Code Templates page