Skip to content
This repository has been archived by the owner. It is now read-only.
This repository has been archived by the owner. It is now read-only.

To improve readability, consider moving the expression-bodied member generated by the "To expression body" refactoring to a new line if resultant expression is really long #78

Open
@jumpinjackie

Description

@jumpinjackie

Using v1.2 of Refactoring Essentials on VS 2015 Community.

If refactoring a really long single-line method/property to an expression-bodied member, the default refactoring result doesn't lend itself to readability (if you apply the standard 80 character code width, or just look at the code example in this post).

In such cases, the expression-bodied member should probably go to the next line. For example

    public string Foo()
    {
        return _foo.SuperCaliFragilisticExpialiDocious(1, 2, 3, 4, "foo", "bar", "baz", 123412383958495943434394839584);
    }

Should for the sake of readability, be converted to this:

    public string Foo() //Newline here
        => _foo.SuperCaliFragilisticExpialiDocious(1, 2, 3, 4, "foo", "bar", "baz", 123412383958495943434394839584);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions