简体   繁体   中英

ReSharper Formatting - put method closing parenthesis on new line

When I declare or call a C# method with multi-line parameters like this:

public void DoSomething(
    p1,
    p2,
    p3);

Then I would like ReSharper to format that code to like this:

public void DoSomething(
    p1,
    p2,
    p3
);

Is there a setting that enables this behavior?

This feature is only available beginning with ReSharper 2018.1 .

Those settings are located here:

Code Editing -> C# -> Formatting Style -> Line Breaks and Wrapping

  1. -> Arrangement of Method Signatures -> Prefer wrap before ")" in declaration
  2. -> Arrangement of Invocations -> Prefer wrap before ")" in invocation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM