DaI*_*mTo 4 c# visual-studio .net-core
我刚刚在这里打开一个旧项目。似乎有人更改了缩进。它设置为2个空格,而不是四个空格制表符。
我尝试过的
_ReSharper.Caches目录,并创建了一个新目录,但缩进没有变化。当这些方法不起作用时,我已开始将Visual Studio中的设置与两种不同的解决方案进行比较。
Resharper设置的矛头是相同的广告,是Visual Studio中的设置。
重新分享设定
Visual Studio设置
哪个使我认为这必须在项目文件之一中?如果不是我的Visual Studio中的设置有问题,什么是覆盖制表符?
值得注意的是,当我加载项目时,我发誓它会加载适当的缩进,然后在最后一秒重新格式化。不确定是否重要,但是项目是.net core 1.0,解决方案中有三个项目,所有三个项目似乎都受到了影响。
希望有人对此有修正,真的很难像这样阅读。
As people says in answers and comments this is probably a .editorconfig. In our case a developer started using VS Code and when upgrading to VS 2017 Visual Studio also accepts these files.
This was the value in the file that was automatically added:
[*]
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
Run Code Online (Sandbox Code Playgroud)
By adding this we could use C# normally and the developer who wanted to use VS Code could continue to do that:
[*.cs]
indent_style = space
indent_size = 4
Run Code Online (Sandbox Code Playgroud)
Visual Studio可能在项目目录(或任何父目录)中使用.editorconfig文件,无论用户设置如何,该文件都可以在代码库中提供一致的代码样式。
Visual Studio应在IDE窗口的左下方区域中进行指示。
在这种情况下,您将需要修改.editorconfig和定义新样式,以更改自动格式化工具的配置。
| 归档时间: |
|
| 查看次数: |
1686 次 |
| 最近记录: |