Formatting rules for method invocations

Answered

Our coding standards allow method invocations with up to 3 arguments on a single line. If there are more than 3 arguments or the arguments are long we require using multiple lines. So far so good - I can configure this using an editorconfig file or through the ReSharper settings.

For multi-line method invocations we require that the closing parenthesis be on its own line. Is there a way to configure the code style settings to match this (admittedly unusual) standard?

// Not allowed
SomeMethod(1, 2, 3, 4);
SomeMethod(1,
2,
3,
4);

// Preferred
SomeMethod(
1,
2,
3,
4
);
0
2 comments

Hello Andrew, thank you for your question.

Does ReSharper | Options | Code Editing | C# | Formatting Style | Line Breaks and Wrapping | Arrangement of invocations | Prefer wrap before ")" in invocation do what you need?

0

Maria Pleskunina Yes, I think if I turn that on for both invocations and method declarations it's pretty close. Thanks!

0

Please sign in to leave a comment.