Language Options

From RAD Studio
Jump to: navigation, search

Go Up to Editor Options


Tools > Options > User Interface > Editor > Language

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

Options tab

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

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.

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 > User Interface > 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 > User Interface > 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.

Code Insight tab

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

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.

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

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.

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

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

Invoke Find Declaration by pressing Ctrl+Click over a symbol or right-clicking it and choosing Find Declaration.

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

Generate LSP Config

Generates .delphi.json files. When enabling this option, the key project settings used by the LSP server are saved to a 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.

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.

Insight Options tab

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

Item Description

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.

LSP Behavior tab

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

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.

Note: These options are for C++ only.

See Also