Formatting change request

Hi there!

I’d like to request a change to formatting. A few months ago, we changed from aligning many-argument function calls all at the function-calling-point to doing it like this.

I’d like to take that one step further and do it like this. It would keep parameters together in the same area (at the new indent level, to the left, rather than splitting them up between there and the function call, on the right), minimize eye back-and-forth, and make the world a better place.

This can be achieved by checking the resharper box for ‘Code Editing > C# > Formatting Style > Line Breaks and Wrapping > Prefer wrap after “(” in invocation’ and probably the corollary box: ‘Code Editing > C# > Formatting Style > Line Breaks and Wrapping > Prefer wrap after “(” in declaration’

1 Like

(Meta: I’d include pictures but the forum complains that I’m too new to use imaging functionality. I’d have included all 3 screenshots in the original post but I’m too new to include more than 2 links. Here’s the original method…mostly because I had already taken the time to make the screenshot.)

I think this is a good idea. It will still only wrap if the line is too long, right?

@greg_smalter and @samrueby, what do you think?

It’s more lines but appears to avoid the ridiculous indenting problem that resulted in code starting on column 80, so let’s give it a try.

Yeah i just tested: it only comes into play if it’s already going to wrap the line - it doesn’t cause it to wrap for short lines where it currently wouldn’t wrap the line.

Yeah, the example given is clearer using the new way.

This is done: I just updated our shared R# settings. Thanks @brendan for the improvement.

1 Like