ReSharper Web Help

ReSharper lets you use any code symbols (classes, methods, properties, fields, variables etc.) before you declare them. When ReSharper detects an undeclared symbol, it suggests several quick-fixes and context actions for generating the corresponding symbol based on the usage, and then smartly adjust the declaration according to the usage context:
'Generate from usage' quick-fix

Tip

You can set up common code generation options in the ReSharper | Options | Code Editing | Members Generation.

For example, if you create a method from usage, ReSharper will not only create a method, but also detect its return type and types of its parameters:
Code_Analysis__Examples_of_Quick-Fixes__undefined_method__return_type

Tip

Depending on your settings, in the bodies of generated implementations ReSharper throws new NotImplementedException(), returns default value, or puts code that will not compile. For more information, see ReSharper | Options | Code Editing | Members Generation

For additional examples of how ReSharper creates code symbols from usages, see Undefined variable and Undefined method call samples in the Examples of Quick-Fixes.


This feature is supported in the following languages/technologies:

C# VB.NET HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

Tip

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