Code Insight

From RAD Studio
Jump to: navigation, search

Go Up to Editor Options


Tools > Options > User Interface > Editor Options > Code Insight

Use this page to configure how Code Insight works while editing code in the Code Editor.

Note: HTML supports only the Code completion, Error insight, and Code template completion features.
Item Description

Use editor font

Use the same font as the Code Editor instead of the standard IDE font.

Source file type

Displays a list of programming and markup languages (HTML, StyleSheet, Pascal, and C/C++), for which you can specify Code Insight features. You can specify different Code Insight options for each language.

Code completion

Displays a list of properties, methods, and events when you enter a class name followed by a period in the Code Editor. You can then select an item and press Enter to add it to your code.

If this option is not checked, you can still invoke Code Completion by pressing Ctrl+Space. The default value is ON (checked).

Auto invoke

Brings up the Code Completion list while you type Delphi or C++ code. C++ also supports the -> for invoking Code Completion.

Auto parenthesis

Automatically adds parentheses to function calls when you invoke Code Completion.

History

Remembers what you have entered or selected, and places that as the first entry in the Code Completion list.

Show reserved words

Includes language keywords (for Pascal only) in the Code Completion list.

Note: For the Clang-enhanced compiler, this feature uses a Language Server Protocol server. It is asynchronous and non-blocking.

Parameter completion

It is auto-invoked for methods after you code-complete that method, or pressing Ctrl+Shift+Space.

Code parameters

Displays the arguments of a method call as you enter them into your code. If this option is not checked, you can still invoke code parameters by pressing Shift+Ctrl+Space. The default value is ON (checked).

Note: For the Clang-enhanced compiler, this feature uses a Language Server Protocol server. It is asynchronous and non-blocking.

Tooltip expression evaluation

Displays the current value of a variable when you position the cursor over it. This feature is available when program execution is paused during a debugging session.

Index for C++ Insights

Provides index for the tooltip insight and go to definition features.

It is the LSP server (cquery) that runs through the project and builds a database. It uses CPU, so it can be turned off through the Index for C++ Insights checkbox.

Tip: Keep in mind that if this option is turned off, both features stop working.

Tooltip insight

It happens when hovering the mouse over a symbol.

Tooltip symbol insight

Displays declaration information in a tooltip window for any identifier by passing the cursor over it in the Code Editor.

Tooltip help insight

Displays a short description in a tooltip window when you pass the cursor over a symbol in the Code Editor. The hint window (Help Insight) contains links to additional information where available.

Note: Only available when using the Classic Compiler.

Go To Definition

Invoke Go To Definition by pressing Ctrl-Click over a symbol or right-clicking it and choosing Go To Definition.

Note:
  • For the Clang-enhanced compiler, this feature uses a Language Server Protocol server. It is asynchronous and non-blocking.

Block completion

Enables the editor to automatically insert a block-closing symbol when you begin a block and press Enter. The default value is ON (checked).

The drop-down menu sets the behavior of block completion when you surround existing statements with block symbols, as follows:

Without new line

Positions the cursor after the block you just created.

With new line

Positions the cursor inside the block you just created.

New blocks only

Invokes block completion only if you start a new block.

Error insight

Underlines invalid code and HTML in red. Positioning the cursor over invalid text displays a tooltip window containing the probable cause of the error. The default value is ON (checked).

Code template completion

Automatically adds a code template when you type a token that starts a template and press TAB. The default value is ON (checked).

Auto complete

Invokes code template completion when you press SPACE after you begin an existing template. When this option is disabled, you must press TAB to invoke template completion after you type in the template name. The default value is ON (checked).

Hints

Enables template hints. Template hints appear when you add a template in the Code Editor and tab between the preset cursor positions in the template. The default value is OFF (unchecked).

Delay

Sets the duration of the pause before a Code Insight window displays. Select a value anywhere on a scale between None and High.

Note:
  • For C++, Code Completion and Error Insight using the Language Server Protocol and cquery are not supported on 32-bit editions of Windows.
  • For C++ Clang, when using Code Completion, a project needs to be saved, once, for Code Completion and Error Insight to work correctly. When the project exists on disk, all changes in the IDE (i.e., modified files) are reflected accurately.

See Also