ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Inline Method refactoring

Last modified: 21 July 2022

ReSharper | Refactor | Inline | Inline…

Ctrl+R I (ReSharper_InlineVariable)

This refactoring helps you replace usages of a static, instance, and extension method with its body, and optionally remove the original method declaration.

You can also apply this refactoring to a property with a backing field. In this case, read usages are replaced with the getter body and write usages are replaced with the setter body.

In the example below, we use this refactoring to inline the LogError method:

ReSharper: Inline Method dialog

This feature is supported in the following languages and technologies:

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by language section.