Using Code Completion
See Also
The IDE has a dynamic C and C++ code completion feature
that enables you to type a few characters and then see a
list of possible classes, methods, variables, and so on that can be used
to complete the expression. You can disable this automatic feature so that code
completion suggestions only appear when you press Ctrl-Space.
To complete a C or C++ expression:
- In the Editor window, type a few characters of an
expression and press Ctrl-Space or Ctrl-\ to open the code completion box.
The code completion box displays a scrolling list of possible classes,
methods, variables, functions, and so on that can complete your expression.
If the IDE can
determine only one possible completion for the expression, the expression is completed
automatically. If the IDE cannot determine how to complete the expression, the
code completion box displays "No suggestions."
- Use the most convenient combination of the following options to select an item
from the code completion box:
- Continue typing to narrow down the selection of items in the list.
- Use the mouse or navigation keys to scroll through the list and select an item. If
the IDE can locate documentation for the items in the list, the documentation is
displayed in another popup window.
- Press Enter or Return to enter the selection in the code completion box into your file.
- Press Escape to close the code completion box without entering the selection.
Notes:
- If you press Enter for a method with parameters,
the parentheses are added and your insertion point is placed inside.
A tooltip shows you the types that you have to fill in for the
parameters. When you select a method from the code completion list,
and the method
is inserted in the file, a tooltip displays the method's parameters.
- You can display suggestions for parameters by putting the
cursor after the "(" or "," in a method invocation and pressing Alt-P.
To disable the automatic display of the completion box:
-
Choose Tools > Options and click Editor.
- In the General tab, deselect the Auto Popup Completion Window checkbox.
Legal Notices