Version Used: VS 2015 Update 3 (14.0.25425.01)
Steps to Reproduce:
1 - Write the following code in a method:
{ }
( 0 ).ToString();
2 - Format the document (e.g. Ctrl+K, Ctrl+D
)
Expected Behavior: The 2nd line's indentation should be reset, i.e. there should be no space before it.
Actual Behavior: Nothing changes.
Note: This is the smallest repro I could find, so it looks pretty stupid; a real-world example is an if statement followed by an operation on an object being casted.
The C# formatting engine doesn't dictate the indentation of continued statements. We provide a _suggestion_ when you press enter, but otherwise the formatting engine just tries to maintain the relative indentation to the first line of the statement if the whole thing moves. There are just too many different styles of indenting continued lines.
I'm a bit confused by your explanation; there's no "continued" statement above, just a block followed by an unrelated statement.
Removing the parentheses leads to the statement being formatted as expected (i.e. same level of indentation as the block itself), which leads me to believe there's something odd going on.
Doh, I mis-read your post, and thought there was a continuation. Re-opening