ReSharper formatting: disable remove spaces for an

2019-07-30 03:20发布

I'm not sure if my title is entire accurate, however, I would like to disable the feature in ReSharper formatting where it removes spaces upon formatting. The following image describes the behaviour (red = before format, green = after format)

: ReSharper formatting

As you can see the spaces before id and after fileId are removed, so:

new { id = fileId } --> new {id = fileId}

I would like to disable this behaviour, and actually (if possible) enforce the leading and trailing space. I can't find what the option is called in the ReSharper -> Options -> C# -> Formatting Style -> Spaces tab.

Any help would be greatly appreciated

标签: c# resharper
1条回答
Bombasti
2楼-- · 2019-07-30 04:05

You can keep the spacing with the option: Within single-line initializer braces.
It can be found here: Resharper -> Options -> Code editing -> C# -> Formatting Style -> Spaces enter image description here

查看更多
登录 后发表回答