编辑器重新格式化c#代码的缩进 [英] Editor reformatting indents for c# code

查看:146
本文介绍了编辑器重新格式化c#代码的缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio的早期版本中编写了大量的c#... 2010,2013,2015。

i have a large body of c# written in previous versions of visual studio... 2010, 2013, 2015.

我最近更新到2017年。

I recently updated to vs 2017.

之前写的c#都是自动格式化的,因此缩进是四个空格。

The c# written previously was all auto formatted so that indents were four spaces.

对于新版本,自动格式化要为每个缩进使用2个空格而不是4。

With the new version, the auto formatting wants to use 2 spaces for each indent instead of 4.

这是一个问题,因为任何新代码都不适合旧代码。

This is a problem, as any new code doesn't fit with old code.

当然我可以重新格式化整个代码doc使用2个空格缩进,但这使得与以前版本的差异很难阅读。

Of course i could reformat the entire doc to use the 2 space indents, but this makes diff'ing with previous versions very hard to read.

我访问过工具/选项/编辑器/所有语言和c#试图摆弄标签设置,但似乎没有任何帮助。

I've visited Tools/options/editor/All Languages and c# to try to fiddle with the tab settings, but nothing seems to help.

这必须是一个错误,对吗?

This has got to be a bug, right?

任何帮助都会非常多赞赏。

any help would be very much appreciated.

谢谢

dmc_lat47

dmc_lat47

推荐答案

这与VS有关。建议您发布
here
 以获取答案很快。
This is related to VS. Will suggest you to post here to get answers fast.


这篇关于编辑器重新格式化c#代码的缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆