问题
When I write an MSpec context like this:
[Subject(typeof(TheType), "Concern")]
internal class when_this_test_is_run
{
Establish context = () =>
{
// some code...
};
Because of = () => Do.Something();
It should_do_this;
It should_do_that;
}
When I let ReSharper reformat the code, it always inserts a blank line beneath any of the delegates that is an anonymous method, i.e. has a {
block }
as its body. It doesn't insert blank lines after delegates that are simple expressions. So in the example above, the Establish context
delegate gest a blank line, but the Because of
and the It
delegates do not.
This is driving me crazy as I don't want it to insert the blank lines, but I can't figure out what setting I need to change to stop it happening.
Any ideas?
回答1:
Try this:
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Preserve existing formatting | Keep max blank lines in declaration | Select '0'
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Blank lines | Around field | Uncheck
来源:https://stackoverflow.com/questions/24855393/how-can-i-prevent-resharper-from-inserting-a-blank-line-between-my-mspec-fields