Language Options

From RAD Studio
(Redirected from Code Insight)
Jump to: navigation, search

Go Up to Editor Options



Tools > Options > Editor > Language

Use this page to configure Code Editor settings for various types of source files.

Item Description
Language Choose a predefined or customized source file type. Choices are: C/C++, C#, Default, HTML, IDL, INI File, JavaScript, Objective C++, Pascal, PHP, SQL, Style Sheet, Visual Basic .NET, and XML.

Options tab

Tools > Options > Editor > Language and click on Options tab.

Item Description

Auto indent mode

Positions the cursor under the first nonblank character of the preceding nonblank line when you press ENTER in the Code Editor.

Use tab character

Inserts tab characters when you press TAB in the Code Editor. If not checked, pressing TAB inserts spaces. If Smart tab is enabled, this option is off. To view tab characters, select Show tab character.

Smart tab

Tabs to the first non-whitespace character in the preceding line. If Use tab character is enabled, this option is off.

Cursor through tabs

Enables the arrow keys to move the cursor to the logical spaces within each tab character.

Optimal fill

Begins every auto-indented line with the minimum number of characters possible, using tabs and spaces as necessary.

Backspace unindents

Aligns the insertion point to the previous indentation level (outdents it) when you press BACKSPACE, if the cursor is on the first nonblank character of a line.

Keep trailing blanks

Prevents trailing blanks from being truncated.

Show tab character

Displays tab characters as >>, if Use tab characters is selected.

Show space character

Displays typed spaces as dots (.).

Use syntax highlight

Enables syntax highlighting. To set highlighting options, use the Color page.

Show line breaks

Displays line break symbols at the end of each line.

Highlight current line

Highlights the current line in the Code Editor.

Tab stops

Set tabs stops that the cursor will move to when you press TAB. Enter one or more integers separated by spaces. If multiple tab stops are specified, the numbers indicate the columns in which the tab stops are placed. Each successive tab stop must be larger than the previous tab stop. If a single tab stop is specified, it indicates the number of spaces to jump each time you tab.

Block indent

Specifies the number of spaces to indent a marked block. The default is 2; the upper limit is 16.

Syntax Highlighter tab

Tools > Options > Editor > Language and click on Syntax Highlighter tab.

Item Description

Syntax Highlighter

Choose an option to change the format for displaying code elements. Check Use syntax highlighting to enable this option.

Error Insight tab

Tools > Options > Editor > Language and click on Error Insight tab.

Item Description

Show Error insight levels

Underlines invalid code and HTML. Positioning the cursor over invalid text displays a tooltip window containing the probable cause of the error. Choose the level of error insight you want to see.

None

Choose this option to not display any level of error insight in the code editor.

Errors Only

Display errors only in the code editor. Errors are displayed with a red underline.

Warnings and Above

Display warnings in the code editor. Warnings are displayed with an orange underline.

Hints and above

Displays Hints in the code editor. Hints are displayed with a blue underline.

Everything

Display all levels of error insight in the code editor.

Editor rendering style

Choose the editor rendering style, choices are: Classic, Smooth Wave, Solid Line, or Dots.

Show Error Insight in editor gutter

Select this option to show the error insight in the editor gutter.

Inactive Code Opacity Percent

This option allows to alpha blend and show a certain color opacity value of an inactive or disabled code. The default is 30.

Code Insight tab

Tools > Options > Editor > Language and click on Code Insight tab.

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

Note: HTML supports only the Code completion, Finish incomplete properties, and Code template completion features.
Note: Code completion is provided by different technologies depending on the language and setting.

For Delphi, Code completion is provided via the DelphiLSP LSP language server.

For C++:

  • The classic compiler uses old-style completion, which runs inside the IDE main thread and can block the IDE while it calculates (you can press Escape to cancel.)
  • The modern Clang compilers use Visual Assist to provide completions by default. VA is a fuzzy parser and aims to provide completions fast, but its results are not always compiler-style accurate. You can turn off the Use Visual Assist checkbox to use the cquery C++ LSP server instead. This enables Error Insight, but is not currently our recommended code completion engine.
Item Description

Code insight manager

Displays a list of programming and markup languages (HTML, StyleSheet, Delphi, 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

The Code Completion list will appear as you type code.

Delay

In Delphi, you can set the duration of the pause before a Code Insight window displays. This delay is configurable, set a value among Only on dot, Immediately (0ms), Very short delay (80ms), Short delay (250ms), Medium delay (500ms), Long delay (1000ms), and Very long delay (2000ms).

Note: Consider the following information:
  • 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 cquery with LSP and Code Completion, a project needs to be saved 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.

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. Only for Delphi.

Show reserved words

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

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

Finish incomplete properties

Determines whether class completion completes property declarations.

Parameter completion

It is auto-invoked for methods after you code-complete that method, or press 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.

Tooltip insight

It happens when hovering the mouse over a symbol.

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.

Tooltip symbol insight

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

Find declaration

Invokes Find Declaration by pressing Ctrl+Click over a symbol or right-clicking it and choosing Find Declaration. Only for Delphi.

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

For more information, see Code Insight Reference.

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.

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).

Use Visual Assist

For C++, enables different refactoring and search options, such as, rename, add Include, create declaration and create implementation, go to related, go to member, find symbol, find references, and go to definition and go to implementation

Generate LSP Config

Generates .delphi.json files. When enabling this option, the key project settings used by the LSP server are saved to a file with the same name as your project and a .delphi.json extension. Use this file when using LSP with an external editor such as Visual Studio Code.

Use 64-bit version of the server Enables the 64-bit version of the DelphiLSP engine.
Note: The 64-bit binaries feature is limited to higher SKUs and is only available in Enterprise and Architect editions. It is not available in the Professional or CE editions.

Insight Options tab

Tools > Options > Editor > Language and click on Insight Options tab.

Item Description

Use editor font

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

Use arrow-right to accept selected code completion item

Accepts the item of your preference by using the arrow-right keyboard.

Use brackets to accept selected code completion item

This option is enabled by default, it accepts the item of your preference by using brackets.

Code completion filtering

Show symbols that contain filter - Select this to list all symbols that contain the text you typed.
  • List all symbols that start with the filter first - Select this option to move symbols that begin with the filter text to the top of the list. If the option is unchecked, then symbols are sorted in alphabetical order.
Select shortest matching symbol - Select this option to select the shortest matching symbol.
Filter text is underlined -Select this option so the code completion dropdown underlines text that matches what you typed.

Code completion auto-selection

Auto-Select template items - Select this option to automatically choose the template items.

Auto-Select keyword items - Select this option to automatically choose the keyword items.

LSP Behavior tab

Tools > Options > Editor > Language and click on LSP Behavior tab.

Note: LSP behavior options are only available for C++.
Item Description

Restart server each time a project is activated

Indexes all files in a project and all files opened in the editor.
We recommend using this option if you only work on one project since once the project is indexed, the Code Insight is responsive for all files in the project.

Note: For all C++ projects, this option is on by default.

Index only files that are opened in the editor

Indexes only the files you open, regardless of your project.
We recommend using this option if you only have to index the file opened in the editor to spend less time re-indexing files.

Index all files in the project group

Indexes all files in all the projects and files opened in the editor when the project group is loaded.
We recommend using this option if you need to index all files and the Code Insight to respond for all files in the project.

Completion Keys tab

Tools > Options > Editor > Language and click on Completion Keys tab.

Use this page to customize the way the IDE responds to keys you press when the Code Completion window is open, both in terms of inserting a completion vs. overwriting the symbol, as well as which keys cause an action.

This allows you to customize completion to match your expectations. For instance, if you're used to a different IDE and have specific interaction habits, you can adjust completion to meet your needs.

By default, auto-invoked code completion inserts a completion with far fewer keys than the normal code completion, only with Tab and Enter. This ensures that it never inserts code by accident as you type. For normal completion, accepting the completion on keys like opening brackets —(— means you can accept a method call by starting the parameter list.

The available options for each key or set of keys are:

  • Inserts - inserts the suggestion.
  • Overwrites - overwrites the editor token with the suggestion.
  • Cancels - cancels or close the completion.

See Also