Hi … I'm struggling to find which combination of formatting options I need to combine in order to get the desired output. Ive played around with spacing, braces, and newlines, and it gets close - but when nested lambdas come into play everything gets a bit hairy. The default VS indentation in this case is preferable.
A picture speaks a thousand words so let s just look and see… Ive set the text to smaller than I generally have it to see more and get a better feel for the output.
Also, you should allow ctrl+v pasting image data directly to this form :p . The amount of idents seems to be related, but only to delcaration or statement - there doesnt seem to be a scope of ("The start of the line that called the method where this inline lambda or block is an argument") … which sounds wordy, but its the default for vs, after a format document / Ctrl K, Ctrl D.
Ahh and i only seem to be able ot add 1 image so i guess i will respond to myself with a comment.
here the undesired excessive unindenting ( but only in this nested case )
Hello,
Formatting results can vary because of the source code and settings. To help us better understand the situation, send us your settings (CodeRush\Support\Settings Folder…) along with the source document (the compilable state is not necessary) you want to format?
ok, for the time being i have just disabled the section that was getting confused : c# > Formatting > Braces > Lambda Expression \ Anon Method
Attached my settings
Repro file attached
And from the screenshot there is one section which uses a local function (https://docs.microsoft.com/en-us/dotnet/csharp/local-functions-vs-lambdas ) which doesn't seem to fall into the same category, but is affected by the same undesirable excessive unindenting.
I've created a separate ticket on your behalf (Formatting - Local function with the lambda expression is formatted incorrectly). It has been placed in our processing queue and will be answered shortly.