I use a very common formatting technique that improves readability, by aligning code.
e.g. 1 with declarations (possible via csharp_space_around_declaration_statements
)
var a = foo;
var bc = 123;
var some = thing;
e.g. 2 not with declarations
a = foo;
bc = 123;
some = thing;
But I'm using the roslyn analyzers, and that triggers IDE0055:Fix formatting
(for the first two lines).
In .editorconfig
, is there a dotnet_xxx
or csharp_xxx
config option (or combination) that allows this style?
Set csharp_space_around_declaration_statements = ignore
in .editorconfig
This setting is located in Text editor -> C# -> Code Style -> Formatting -> Spacing -> ignore spaces in declaration statements
Although I don't know a way to disable autoformat in pattern matching:
static int Foo(int x, int y) => (x, y) switch
{
( 0, 0) => 0,
(int i, 0) => 11,
(int i, int j) => i + j,
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With