Multiple single line foreach indentation style

Answered

Hi, I'd like to get rider to indent multiple foreach statements when reformatting code.

What setting do I change?

I want this:

foreach (var productInfo in productList)
foreach (var baseName in BaseNames)
imageList.AddRange(CreateImages(productInfo, baseName, ""));

But Rider does this:

foreach (var productInfo in productList)
foreach (var baseName in BaseNames)
imageList.AddRange(CreateImages(productInfo, baseName, ""));
2 comments
Comment actions Permalink

Pieter, thank you for your question.

Please enable the following option: File | Settings | Editor | Code Style | C# | Tabs, Indents, Alignment | Nested statements | Indent nested 'foreach' statements. Does it work for you?

0
Comment actions Permalink

That works, thank you.

0

Please sign in to leave a comment.