7

我想配置我的 EditorConfig ( https://editorconfig.org/ ) 配置,通过在左括号和右括号之前添加空格var v = new Object(kind) {Id = num++};来自动重新格式化C# 代码片段。var v = new Object(kind) { Id = num++ };我浏览了文档并检查了 C# 手册(https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#example-editorconfig-文件),但还没有找到解决方案。

4

2 回答 2

0

根据官方.editorconfig文档,请在此处查看.editorconfig 完整的属性列表,如下所示:

.editorconfig

[*]
spaces_around_brackets = inside
于 2021-07-06T12:43:29.967 回答
-3

您可以将其定义.editorconfig

它是为 Visual Studio 社区 2019 设计的,但也可以在其他版本中使用。此外,您需要配置 VS 以在“保存操作”上应用这些设置,请参阅

于 2019-11-22T12:45:18.093 回答