ReSharper Help

Fix in Scope

Most of quick-fixes can fix the current issue under the caret, but some of them (e.g. Remove unused directives, Make field read-only, Remove redundant cast, etc.) can also automatically find and fix issues in a larger scope - in the current file, in the current project or in the whole solution.

In this topic:

Applying fix in scope

You can recognize such fix by a small arrow displayed next to it in the action list.

Scalable quick-fix

To apply fix in scope

  1. Set the caret to a code issue highlighted by a ReSharper's inspection.
  2. Press Alt+Enter or click on the action indicator to the left of the caret to open the action list.
  3. Choose a quick fix that you want to apply.
  4. Click on the arrow to right of the quick-fix or press the right arrow key to expand the list of available scopes. If there is no arrow to the right of a quick-fix, then this quick-fix only applies locally.
  5. Select the scope for the quick-fix to apply and click on it or press Enter.

All files where ReSharper applies fix in scope open in editor tabs. If necessary, you can undo all that was changed in these files with a single command: choose Edit | Undo in the main menu or press Ctrl+Z.

Fixing inconsistent naming in scope

The quick-fix that fixes inconsistent naming, calls the Rename refactoring to make sure that all occurrences of the symbol are renamed in your solution.

Fix in scope: bulk rename

Therefore, when you choose to fix naming in a wider scope, ReSharper displays an additional dialog where you can select items to rename:

Fix in scope: bulk rename

The list of quick-fixes that can be applied in wider scope

The full list of quick-fixes that can be applied in wider scopes includes:


  • Remove redundant qualifier


  • Use string interpolation
  • Fix naming
  • Import missing references
  • Import all types
  • Make fields readonly


  • Remove unused directives


  • Remove redundant 'imports'


  • Optimize register directives


  • Add/change quotes everywhere


  • Fix 'public' modifier presence
  • Fix relative path style
  • Use 'any' explicitly
  • Remove redundant qualifiers
  • Optimize reference comments
  • Optimize 'import' statements
  • Import all types
  • Typescriptify
  • Fix type explicitness
  • Convert all obsolete constructs to ECMAScript 6


  • Convert to template string
  • Correct variable kinds
  • Move all variables to narrower blocks
  • Add/change quotes everywhere
  • Terminate all unterminated statements


  • Use expression body for
  • Cleanup whitespace
  • Unwrap immediate delegates
  • Use count access
  • Use 'nameof' expressions
  • Arrange qualifiers everywhere
  • Arrange qualifiers everywhere
  • everywhere
  • Arrange qualifiers everywhere
  • Make properties get-only
  • Remove redundant parameter arrays
  • Remove redundant assignments
  • Remove redundant initializers
  • Remove redundant constructors
  • Remove redundant base constructor invocation
  • Make field read-only
  • Remove redundant jump statements
  • Use array initializer everywhere
  • Remove redundant commas
  • Remove redundant 'string.Format()' calls
  • Convert to auto-properties
  • Remove attributes
  • Use 'var' or explicit type depending on the code style settings.
  • Remove redundant argument(s) value
  • Remove redundant argument name specifications
  • Remove all empty initializers
  • Remove redundant parenthesis in lambda signatures
  • Remove prohibited modifier(s)
  • Import missing references
  • Import item and all other references
  • Invoke all methods as extensions
  • Remove 'new' modifiers when not necessary
  • Remove unused directives
  • Remove prohibited modifier(s)
  • Remove redundant '()'
  • Remove redundant as operator calls
  • Remove redundant cast expressions
  • Remove redundant comparisons
  • Remove redundant constructors
  • Remove prohibited modifier(s)
  • Remove prohibited modifier(s)
  • Remove unused labels
  • Remove 'partial' keyword from all types with single part
  • Remove prohibited modifier(s)
  • Remove redundant type specifications
  • Remove redundant 'base()' calls
  • Remove redundant braces in collection initializers
  • Remove redundant delegate constructor calls
  • Remove all redundant else keywords
  • Remove redundant names
  • Remove redundant 'new'
  • Remove redundant parenthesis in attributes
  • Remove redundant 'ToCharArray()' calls
  • Remove redundant conditions in for statements
  • Remove redundant type arguments
  • Remove redundant 'int' in enum declarations
  • Replace 'unsafe' statements with their bodies
  • Remove 'sealed' keyword when it is not applicable
  • Remove redundant anonymous method signatures
  • Remove prohibited modifier(s)
  • Remove redundant 'ToString' method calls
  • Remove prohibited modifier(s)
  • Remove 'unsafe' modifiers when they are not necessary
  • Rewrite all nullable types


  • Make field read-only
  • Remove redundant 'imports'
  • Remove redundant parentheses
  • Remove redundant qualifiers
  • Remove 'ByVal' modifiers
  • To implicitly typed variables

This feature is supported in the following languages/technologies:

C# VB.NET C++ 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

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.

See Also

Last modified: 21 September 2015