JetBrains Rider 2024.3 Help

Syntax highlighting

JetBrains Rider highlights fields, local variables, types, and other identifiers with configurable colors. For example, JetBrains Rider syntax highlighting allows you to easily distinguish between local variables and fields in your code.

JetBrains Rider syntax highlighting for C# with default colors looks as follows:

JetBrains Rider: Syntax highlighting in C#

Toggle JetBrains Rider syntax highlighting

  1. Press Ctrl+Alt+S or choose File | Settings (Windows and Linux) or JetBrains Rider | Preferences (macOS) from the menu , then choose Editor | Inspection Settings on the left.

  2. Use the Color Identifiers checkbox to enable or disable JetBrains Rider syntax highlighting.

  3. Click Save in the Settings dialog to apply the modifications and let JetBrains Rider choose where to save them, or save the modifications to a specific settings layer by choosing this layer from the Save selector. For more information, see layer-based settings.

Configure syntax highlighting

To configure syntax highlighting, you can select one of the default color schemes and then customize it if necessary.

You can also customize each identifier color right from the editor:

See the color scheme settings for the current symbol

  • Place the caret at the desired symbol, press Ctrl+Shift+A, find the Jump to Colors and Fonts action, and execute it.

This will open the relevant color scheme settings for the symbol under the caret.

Semantic highlighting

By default, the color scheme defines syntax highlighting for reserved words and other symbols in your source code: operators, keywords, suggestions, string literals, and so on. If you have a function or method with many parameters and local variables, it may be hard to distinguish them from one another at a glance. You can use semantic highlighting to assign different random colors to each parameter and local variable.

JetBrains Rider: Semantic highlighting is enabled
JetBrains Rider: Semantic highlighting is disabled

Enable semantic highlighting

  1. Press Ctrl+Alt+S to open settings and then select Editor | Color Scheme | Language Defaults | Semantic highlighting.

  2. Select Semantic highlighting and customize the color ranges if necessary.

Semantic highlighting

This will enable semantic highlighting for all languages that inherit this setting from Language Defaults. To enable it for a specific language instead (for example, C#), go to the Editor | Color Scheme | C# | Semantic highlighting settings page  Ctrl+Alt+S, clear the Inherit values from checkbox, and select the Semantic highlighting checkbox.

Last modified: 13 January 2025