Not only does ReSharper highlight errors but it also provides useful Quick-Fixes for many of them, which allow you to instantly correct your code.
) appears at the beginning of the current line.Quick-Fixes are available in a variety of circumstances too large to be listed. We illustrate their use on a small selection of "typical" situations:
Whenever the type of the expression cannot be implicitly cast to the type applicable to the expression context, ReSharper detects this error and highlights it in the editor. After positioning the caret at the highlighted error and pressing Alt + Enter the user will be presented with the following list of quick-fixes:

The effects of applying the proposed quick-fixes are illustrated in the table below.
| Quick-fix | Effect |
|---|---|
| Cast to 'string' | ![]() |
| Safely cast to 'string' | ![]() |
| Change type of 's' to 'object' | ![]() |
Whenever ReSharper detects an undefined variable in your code, the error gets highlighted. After positioning the caret at the highlighted error and pressing Alt + Enter you will be presented with the following list of quick-fixes:

The effects of applying the proposed quick-fixes are illustrated in the table below.
| Quick-fix | Effect |
|---|---|
| Change all 's' | We have changed the name s to myString in this example. The new name needs to be entered only once; ReSharper takes care of changing the undefined name everywhere:
|
| Create field 's' | A new private field named s gets created in the current class. The following popup list appears helping the user to choose the correct type of the new field:
|
| Create local variable 's' | Similar to the previous quick-fix, but instead of a new field a new local variable named s is created. |
Whenever ReSharper detects a call to an undefined method in your code, the error gets highlighted. After positioning the caret at the highlighted error and pressing Alt + Enter you will be presented with the following list of quick-fixes:

After applying the quick-fix, the code looks as follows:
| Quick-fix | Effect |
|---|---|
| Create method 'someMethod'1 | Declares a new method with the signature determined from the method call. In our example, the following declaration appears in the class Class2:
ReSharper also suggests types and names for the parameters of the new method:
|
| Change all 'someMethod' | Similarly to the corresponding quick-fix for undefined variable errors, allows the user to quickly replace all occurrences of the symbol someMethod |
This quick-fix is especially well-suited for the top-down programming technique enthusiasts.
If a method is expected to return a value but you have forgotten to provide a return statement, ReSharper warns you about that by highlighting the closing brace of the troublesome method. After positioning the caret at the highlighted error and pressing Alt + Enter you will be presented with the following quick-fix:

After the quick-fix is applied, the code looks as follows:

Sometimes you have a type name that cannot be resolved because the corresponding "using" directive is missing in the source file. ReSharper detects this and suggests to insert the missing directive as follows

Press Alt + Enter or select the line in the popup to insert the "using" directive. If there are multiple types containing the matching name, you will be prompted to choose the right one.
Context Actions | Error Highlighting | Advanced Editing Features