Line-up Parameters

Moves parameter declarations up so they are all on the same line.

Purpose

If a method's parameter list gets smaller, and there's no more need to keep parameters declared across multile lines, this refactoring will save you some text formatting work, by automatically moving all parameters to the same line with proper spacing.

Availability

  • when the caret is on a method whose parameters are declared across multiple lines.

Notes

Example

private string TestMethod(string p1, 
    string p2, 
    string p3)
{
    return String.Format("{0}, {1}, {2}", p1, p2, p3);
}
Private Function TestMethod(ByVal p1 As String, _
    ByVal p2 As String, _
    ByVal p3 As String) As String
    Return String.Format("{0}, {1}, {2}", p1, p2, p3)
End Function

Result:

private string TestMethod(string p1, string p2, string p3)
{
    return String.Format("{0}, {1}, {2}", p1, p2, p3);
}
Private Function TestMethod(ByVal p1 As String, ByVal p2 As String, ByVal p3 As String) As String
    Return String.Format("{0}, {1}, {2}", p1, p2, p3)
End Function

Screehnshot

rsLineUpParameters

See Also