ReSharper Web Help

ReSharper provides the ability to review errors, warnings, suggestions, etc. with Marker Bar and Status Indicator. As usual, warning markers are orange, error markers are red, suggestion markers and green, and to-do markers are cyan. You can get pop-up tips about errors and warnings by hovering the mouse pointer over corresponding markers, and you can navigate directly to relevant lines of code by clicking on them.

Quick-fixes are represented by the red light bulb or other symbols that appear automatically to the left of a highlighted code line (see Quick-Fixes ), when you position the caret on the highlight. Context actions are designated by a yellow bulb. For both of them you can display the drop-down list either by clicking the light bulb or by pressing Alt+Enter.

Available quick-fixes and context actions are listed below:

Move to Resource

There are two algorithms that can be applied when ReSharper searches for localizable strings : Pessimistic and Optimistic. If Pessimistic is chosen, ReSharper analyzes all possible elements, except those which have attribute Localizable(false). If Optimistic is chosen, ReSharper analyzes only elements with attribute Localizable(true). Depending on this settings, ReSharper highlights strings and includes the Move to resource refactoring in the drop-down list of quick-fixes.
Quick-Fixes
Click the Purple Pyramid pyramid or press Alt+Enter to expand the list of quick-fixes. Choose Move to resource refactoring and apply it. See Move to Resource topic for details.

 Note

For more information about the Properties window, see Properties Window .

Create Resource File

If resource file name is used in code file, but you haven't created the file yet, ReSharper can do it for you. It highlights the resource file name in red and suggests quick-fix:
Quick-Fixes
After applying the quick-fix, the .resx file with corresponding name is created.

Create Resource Item

If resource name is used in code file, but you haven't yet declared this resource, ReSharper can do it for you. It highlights the resource name in red and suggests quick-fix:
Quick-Fixes
After applying the quick-fix, the new resource declaration is added in specified .resx file.

Disable Localization for This Project

If you want to disable localizable features in the current project, apply this quick-fix. Position the caret at the string that can ba localized, press Alt+Enter to expand the list of quick-fixes and choose this one:
Quick-Fixes
After applying the quick-fix, analysis is disabled.

 Tip

To enable localizable features, change the value of the Localizable property from No to Yes or Default in the Properties window.

Annotate Type with 'localizable(False)'

This group of quick-fixes sets 'false' value to the Localizable attribute for chosen type.

Declare Resource Entry

If there are several cultures organised in the culture hierarchy and there is resource entry that is declared in specific culture, but is not declared in neutral culture, ReSharper highlights the resource declaration in grey. Press Alt+Enter, choose a quick-fix from the drop-down list:
Quick-Fixes
After applying the quick-fix, resource declaration is inserted in specific or neutral culture where you can replace its value with a new one.
Quick-Fixes

Override Resource Entry

If there are several cultures organised in the culture hierarchy and there is resource entry that is declared in neutral culture, but is not overriden in specific culture, ReSharper highlights the name of resource. Position the caret at the highlighted warning and press Alt+Enter, choose a quick-fix from the drop-down list:
Quick-Fixes

Remove Resource Entry

If a resource entry has equal values in neutral and specific cultures, ReSharper highlights resource definition in grey and suggests quick-fix. Press Alt+Enter to expand the list and choose quick-fix:
Quick-Fixes
If there are two or even more declarations with the same resource name, ReSharper highlights resource name and suggests quick-fix:
Quick-Fixes
If there are several cultures organised in the culture hierarchy and there is resource entry that is declared in specific culture, but is not declared in neutral culture, ReSharper highlights the resource declaration in grey and suggests quick-fix.
After applying the quick-fix, resource declaration is removed from appropriate culture.

Remove Redundant Type

According to the ReSharper analysis specifying the string type for resource entry is redundant because it's the default resource entry type. ReSharper highlights attribute and its value in grey and suggests a quick-fix:
Quick-Fixes
After applying the quick-fix, the attribute and its value are removed from resource declaration.

Safe Delete

If there are several cultures organised in the culture hierarchy and there is resource entry that is declared in neutral culture, but is not overriden in specific culture, ReSharper highlights the name of resource and includes the Safe Delete refactoring in the list of quick-fixes. Position the caret at the highlighted warning and press Alt+Enter to expand the list:
Quick-Fixes
See Safe Delete Resource for details.

Move HTML to Resource

This context action is available when text or a part of HTML code that should be moved is selected. Click the pencil or press Alt+Enter to expand the list of quick-fixes and context actions. Choose the Move HTML to resource context action. The Select Resource File drop-down list opens, you can choose .resx file where the selected text should be moved. If there is no local resource file, the name of such file is written italic. The appropriate file will be created automatically.
Move HTML to resource
If all .resx files exist:
Move HTML to resource
If local resource file is chosen:
Move HTML to resource
New resource declaration is added to the local resource file:
Move HTML to resource
If global resource file is chosen:
Move HTML to resource
New declaration is added to the global resource file:
Move HTML to resource

See Also

Procedures