RAD Studio (Common)
ContentsIndex
PreviousUpNext
Using Code Insight

Code Insight (sometimes referred to as Code Completion) is a set of features in the Code Editor and the HTML Tag Editor that provide code completion, display code parameter lists, and show tool tips for expressions and symbols. 

The hint window list box filters out all interface method declarations that are referred to by property read or write clauses. The list box displays only properties and stand-alone methods declared in the interface type.

To enable Code Insight (general task)

  1. Choose ToolsOptionsCode Insight.
  2. On the Code Insight page, review and set the Code Insight options and color preferences as needed. Tasks that follow this one in this help topic give more details about some of the Code Insight settings.
  3. Click OK.

To enable and use Code completion

  1. Choose ToolsOptionsCode Insight.
  2. On the Code Insight page, check Code Completion.
  3. To display a list of types, properties, methods, and events in the Code Editor, type either a dot (.) (for Delphi or C++) or an arrow (—>) (for C++) following the name of an object or class name. To display the properties, methods, and events available in a class, type the name of a variable and then press Ctrl + Space.
  4. Select the displayed element that you want to complete the class or object, and press ENTER. To cancel the code completion, either Backspace or press Esc.

Code Insight Examples

  1. If you're using the C++ language, type the name of a variable that represents a pointer to a class instance followed by Ctrl + Space to display the properties, methods, and events available in the class. To invoke code completion for a pointer type, the pointer must first be de-referenced. For example, type this for C++ or selffor Delphi.
  2. If you're using the C++ language, type an arrow (->) for a pointer to an object. You can also type the name of non-pointer types followed by a period (.) to see its list of inherited and virtual properties, methods, and events. For example, for Delphi, type: var test: TRect;: : begintest. For C++, type TRect test; test.
  3. Type an assignment operator or the beginning of an assignment statement and press Ctrl + Space to display a list of possible values for the variable.
  4. Type a procedure, function, or method call and press Ctrl + Space to display the method and it's list of arguments.
  5. Type a record to display a list of fields. (This is the same as Step 1, but uses records instead of classes.)

To enable and use Code parameters

  1. Choose ToolsOptionsCode Insight.
  2. Check the Code parameters check box.
  3. To use Code completion to display the method arguments in the Code Editor, type a method name and an open parenthesis (().

To enable and use ToolTip expression evaluation

  1. Choose ToolsOptionsCode Insight.
  2. Check the ToolTip expression evaluation check box.
  3. To display the current value of a variable while your program has paused during debugging, point the mouse cursor to any variable name displayed on the Code Editor.

To enable and use ToolTip Symbol Insight

  1. Choose ToolsOptionsCode Insight.
  2. Check the ToolTip symbol insight check box.
  3. While editing your code in the Code Editor, point the mouse cursor to any identifier to display its declaration.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!