ReSharper formatting: disable remove spaces for anonymous object creation

你。 提交于 2019-12-11 06:23:08

问题


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)

:

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


回答1:


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



来源:https://stackoverflow.com/questions/44630190/resharper-formatting-disable-remove-spaces-for-anonymous-object-creation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!