Inlay hints
Configure: Settings/Preferences | Editor | Inlay Hints
Push-to-Hint: press Ctrl twice and hold it
Inlay hints are configurable editor adornments that improve the readability of your code.
Inlay hints can be helpful, but on the other hand, they take editor space and may seem redundant in some cases. To view inlay hints on demand, you can use the Push-to-Hint mode. It lets you keep the hints hidden and only view them when needed.
Make sure that the application focus is in the editor.
Press the Ctrl key twice and hold it after the second press. Inlay hints will be shown as long as you are holding it.
If you want to continue showing inlay hints after releasing the Ctrl key, click the corresponding adornment in the top right corner of the editor:
To stop showing inlay hints, click the Push-to-Hint adornment once again.
If you want inlay hints to be always shown or hidden in all editor tabs, use the Default visibility selector on the Editor | Inlay Hints page of JetBrains Rider settings CtrlAlt0S. Whatever you choose for the default visibility, you can override it for specific kind of hints on the corresponding settings pages under Editor | Inlay Hints.
If the press-and-hold or double-press of the Ctrl key is already bound to some other actions in your OS or other applications, JetBrains Rider will override those mappings even if you don't use Push-to-Hint. To avoid that, clear the Reserve double-press-and-hold of the Ctrl key for Push-To-Hint checkbox on the Editor | Inlay Hints page of JetBrains Rider settings CtrlAlt0S.
tip
If you choose Always Show mode for inlay hints, you can still quickly toggle them with the corresponding checkbox in the 'Pencils' widget.
As an alternative to writing named arguments in method calls, you can make use of JetBrains Rider's parameter name hints — editor adornments that show parameter names next to the corresponding arguments at method calls.
Consider the following method call:
AddCheckbox(true, true, "AutoFill", null);
When you read this code, you have to stop and study the method signature to understand what happens here (you can do it either with the parameter information tooltip or by navigating to method declaration). With parameter name hints, the same call becomes much clearer:

The idea of the parameter name hints is to show parameter names for arguments whose intention may not be clear, but at the same time not to clutter the editor with hints where the argument purpose is obvious, and of course if there are named arguments in the call. To achieve this, JetBrains Rider applies a number of configurable heuristics.
tip
With JetBrains Rider, you can also configure a code style preference that will suggest using named arguments in your code.
Type name hints help you understand types variables and expressions have in different contexts. For example:
anonymous types,
parameters of lambda expressions,
return types of methods in a call chain,
and in many other cases.
If necessary, you can configure type name hints for each specific case.
Type conversion hints show implicit type conversions in your code.
In the example below, converting from Vector3D
to Vector2D
silently loses data (the Z
value) and the hint helps us see where this happens.

If you see that a type conversion hint for a specific conversion is not very helpful, you can disable conversion hints for all conversions involving those specific types. To do so, place the caret next to the assignment operator, press AltEnter and choose Configure Inlay Hints | Type Conversion Hints | Hide for.... The change will be saved, and you will be able to review or revert it later on the Editor | Inlay Hints | C# | Type Conversion Hints page of JetBrains Rider settings CtrlAlt0S.
You can display missing returns in functions and missing breaks in switch statements using inlay hints. This lets you immediately understand what exactly is missing:

You can use inlay hints to see places where resource variables are disposed:

If you are using the [MustDisposeResourceAttribute] from JetBrains.Annotations to enforce resource disposal in the calling code, JetBrains Rider helps you visually identify constructors and factory methods that return a disposable resource:

To configure visibility of these hints, use the corresponding selectors on the Editor | Inlay Hints | C# | Other page of JetBrains Rider settings CtrlAlt0S.
Inlay hints will help you spot intercepted calls, with the additional ability to navigate to the interceptor method with AltEnter or with Ctrl+click on the hint icon:

The [InterceptsLocation] annotation on the interceptor method has a hint that allows you to navigate to the intercepted call:

To configure visibility of these hints, use the corresponding selectors on the Editor | Inlay Hints | C# | Interceptor Hints page of JetBrains Rider settings CtrlAlt0S.
You can see tuple component names as inlay hints when those names are not apparent from the component expression:

Inlay hints can greatly improve the readability of a deconstruction pattern by showing the declared names of its components:

When a method returns more variables than needed, and some are discarded with _
, inlay hints can help you see what is discarded. By default, hints for discards work with push-to-hint:

To configure visibility of these hints, use the corresponding selectors on the Editor | Inlay Hints | C# | Other page of JetBrains Rider settings CtrlAlt0S.
#pragma warning
directives allow you to disable and restore specific warnings by their ID. It is hard to remember what each ID means, therefore JetBrains Rider can add inlay hints with warning descriptions. Note that this kind of hints only work with compiler warnings, whose IDs start with CS
.

To configure visibility of these hints, use the corresponding selectors on the Editor | Inlay Hints | C# | Other page of JetBrains Rider settings CtrlAlt0S.
You can toggle and configure inlay hints on the corresponding settings pages under the Editor | Inlay Hints page of JetBrains Rider settings CtrlAlt0S.
If you do not use inlay hints, you can disable them by clearing the Enable Inlay Hints in .NET languages checkbox on the Editor | Inlay Hints | General settings page. JetBrains Rider will stop calculating hints thus saving some resources.
However, if you want to see only a few specific kinds of hints, you can set the Default visibility selector on that page to Never Show and then override this with visibility selectors for the desired types of hints.
For parameter name hints, you can additionally hide hints in methods matching specific patterns. To do so, add these patterns at the bottom of the Editor | Inlay Hints | [language] | Parameter Name Hints page of JetBrains Rider settings CtrlAlt0S.
Here are some examples of patterns:
System.Math.*
matches all methods whose FQN starts withSystem.Math
System.Math.*(*, *)
matches all methods fromSystem.Math
namespace with two parameters(*info)
matches all single-parameter methods where the parameter name ends withinfo
(key, value)
matches all methods with parameterskey
andvalue
Put(key, value)
matches allPut
methods with parameterskey
andvalue
When your caret is at a code item that has an inlay hint, you can press AltEnter, choose Configure Inlay Name Hints, or instead, right-click a parameter hint, and then pick one of the commands, which allow you to:
hide parameter hints for all calls of the method, or type name hints that apply for the current item (if you want to show hints that you disabled, you can find the corresponding item or exception pattern in the options page and remove it),
change visibility of this kind of hints,
disable inlay hints altogether (you can enable them later in the options page),
or open the options page for detailed configuration.

If you right-click a paramter name, type name, or a type name hint, you can also navigate to the declaration of the corresponding type or parameter declaration:

You can configure the color of inlay hints on the Editor | Color Scheme | Language Defaults settings page CtrlAlt0S — choose the Inline parameter hints | Default item.