ReSharper Web Help

ReSharper allows you to quickly change the order of code elements by moving them up or down. In particular, you can:

 Warning

You should move code elements at your own risk since ReSharper neither checks if in any specific circumstances moving them would be valid nor fixes any references. For full-fledged refactorings that solve related tasks, see Move and Change Signature .
To move a type member up or down
  1. Place the caret anywhere in a member declaration:
  2. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Up/Down. Alternatively, press Ctrl+Shift+Alt+Up or Ctrl+Shift+Alt+Down to move a member up or down, respectively.
    The member moves in the specified direction. For example, as shown in the image below, pressing Ctrl+Shift+Alt+Down moves a member down:
To reorder method parameters
  1. Place the caret at any parameter in a method declaration or a method call:
    Moving method parameters
  2. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Left/Right. Alternatively, press Ctrl+Shift+Alt+Right or Ctrl+Shift+Alt+Left to move the parameter to the right or to the left within the signature:
    Moving method parameters

     Tip

    For reordering method parameters both in method declaration and all its usages, use the Change Signature refactoring.
To move statements within a block
  1. Place the caret anywhere in the statement.
    Coding_Assistance__Moving_Code_Elements__move_statements_within_01
  2. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Up/Down. Alternatively, press Ctrl+Shift+Alt+Up or Ctrl+Shift+Alt+Down to move current statement up or down within the block of code.
    Coding_Assistance__Moving_Code_Elements__move_statements_within_02
To move statements out of or into a block
  1. Place the caret anywhere in the statement.
    Coding_Assistance__Moving_Code_Elements__move_statements_out_of_01
  2. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Left/Right. Alternatively, press Ctrl+Shift+Alt+Left or Ctrl+Shift+Alt+Right to move current statement out of or into the block of code correspondingly.
    Coding_Assistance__Moving_Code_Elements__move_statements_out_of_02
To move XML tags up and down, as well as XML attributes left and right
  1. Place the caret anywhere in the tag.
    Coding_Assistance__Moving_Code_Elements__move_xml_tags_01
  2. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Up/Down/Left/Right. Alternatively, press Ctrl+Shift+Alt+Up or Ctrl+Shift+Alt+Down to move current tag up and down within parent tag or Ctrl+Shift+Alt+Left or Ctrl+Shift+Alt+Right to move current tag out of or into some other tag.
    Coding_Assistance__Moving_Code_Elements__move_xml_tags_02
  3. Place the caret at the attribute name.
    Coding_Assistance__Moving_Code_Elements__move_xml_tags_03
  4. On the main menu, choose ReSharper | Edit | Rearrange Code | Move Left/Right. Alternatively, press Ctrl+Shift+Alt+Left or Ctrl+Shift+Alt+Right to move attribute left or right within the tag.
    Coding_Assistance__Moving_Code_Elements__move_xml_tags_04

See Also

Procedures

Reference

External Links