ReSharper 2021.1 Help

C# Type Name Hints

ReSharper | Options | Environment | Inlay Hints | C# | Type Name Hints

Use this settings page to configure inlay hints for type names at variables and expressions.

General

Use compact type name presentation

Sometimes type names can be too long. For example, an anonymous type with a few fields will look like this:

ReSharper: Inlay hints. long type name

When this option is enabled, a shortened type name is displayed in the hint. You can hover the mouse over the hint to see the full type name.

ReSharper: Inlay hints. compact type name
Hide if type name is evident from variable name

This option hides type name hints in cases similar to the following one:

ReSharper: Inlay hints in evident cases

Method return type

These hints will appear after functions if the next function in the chain is written in a new line:

ReSharper: Inlay hints return type in call chain
Visibility

Use the selector to choose how inlay hints for function return type should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Include property, field and variable accessors in invocation chain
Hide for single invocations and one-line method chains
Hide for the last invocation when hint is irrelevant
Join hints for sequences of method invocations with the same return type
Mode

Implicitly typed variables

This kind of hints lets you display type names for var s.

Visibility

Use the selector to choose how type name hints for implicitly typed variables should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Hide if type of variable is evidentThis option is enabled by default so that hints of this kind will not appear where they are not necessary for understanding the type. To learn more, which cases ReSharper considers evident, see Use 'var' when evident: what is considered evident?.

Pattern matching expressions

This kind of hints lets you show type names for var s, recursive patterns, and tuples in C# pattern matching expressions. For example:

ReSharper: Inlay hints. pattern matching

Use the Visibility selector to choose how type name hints for pattern matching expressions should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Lambda expression parameters

This kind of hints displays type names after parameters of lambda expressions.

ReSharper: Inlay hints. lambda expression parameter
Visibility

Use the selector to choose how type name hints for implicitly typed variables should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Hide if types of parameters are evidentThis option is enabled by default so that hints of this kind will not appear where they are not necessary for understanding the type. To learn more, which cases ReSharper considers evident, see Use 'var' when evident: what is considered evident?.

LINQ range variables

This kind of hints displays type names in LINQ expressions.

ReSharper: Inlay hints in LINQ expressions

Use the Visibility selector to choose how type name in LINQ expressions should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Target typed new expressions

This kind of hints displays type names in target-typed new expressions.

Visibility

Use the selector to choose how type name hints for target-typed new expressions should be displayed in the editor: choose Default to apply the general visibility preference from the Environment | Inlay Hints | General page of ReSharper options, choose Show Always or Never Show to always show or hide hints, or choose Push-to-Hint to hide the hints by default but show them when you press and hold Ctrl.

Hide if target type is evidentThis option is enabled by default so that hints of this kind will not appear where they are not necessary for understanding the type. To learn more, which cases ReSharper considers evident, see Use 'var' when evident: what is considered evident?.
Last modified: 09 March 2021