Break Apart Arguments

Places each argument to a method call on a separate line.

Purpose

This refactoring is useful when dealing with lengthy parameter lists. It can make your code more readable by placing each argument on a separate line. Sometimes, this can help you avoid horizontal scrolling.

Availability

Available from the context menus or via shortcuts:

  • when the caret is inside a multi-argument method call.

Notes

Options

Use the Editor | Refactoring | Break Apart Parameters node in the Options dialog to specify the following:

  • The minimum number of arguments required to make this refactoring available.
  • The alignment for arguments that are moved to separate lines.

Example

TestMethod("First Name", "FamilyName", 25);
TestMethod("First Name", "FamilyName", 25)

Result:

TestMethod("First Name", 
    "FamilyName", 
    25);
TestMethod("First Name", _
    "FamilyName", _
    25)

Screenshot

rsBreakApartArguments

See Also