devoured elysium
devoured elysium

Reputation: 105067

Changing the spacing behaviour in Resharper to multi-line lambda in-the-spot expressions

How to convert the ugly

Task t1 = new Task(() => {
                        for (int i = 0; i < int.MaxValue; ++i) {
                            Console.WriteLine(i);
                        }
                    });

to something more palatable, such as

Task t1 = new Task(() => {
    for (int i = 0; i < int.MaxValue; ++i) {
        Console.WriteLine(i);
    }
});

in Resharper?

Thanks

Upvotes: 3

Views: 872

Answers (1)

Dmitry Osinovskiy
Dmitry Osinovskiy

Reputation: 10118

Go to ReSharper | Options -> Code Editing | C# | Formatting Style | Other, turn off Align Multiline Constructs | Anonymous method body. This is for ReSharper 7.1, maybe in previous versions you'd also need to look for some settings on the same page, but in Other section.

Upvotes: 2

Related Questions