本文介绍了可以视觉工作室自动缩进/格式的预处理指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
的
说我要在Visual Studio中键入以下内容:
Say I want to type this in Visual Studio:
class Program
{
private const Byte NUM_THREADS =
#if DEBUG
1;
#else
8;
#endif
}
如果我只需键入它(即不手动修复任何压痕),Visual Studio将其格式化是这样的:
If I simply type it out (i.e. not manually fix any indentation), Visual Studio will format it like this:
class Program
{
private const Byte NUM_THREADS =
#if DEBUG
1;
#else
8;
#endif
}
有什么我可以这样做,它会自动缩进所以它看起来像第一个例子?
Is there anything I can do so it automatically indents so it looks like the first example?
推荐答案
不幸的是,有没有办法让预处理器命令跟随代码缩进。希望它做虽然。 (
Unfortunately, there is no way to have preprocessor commands follow the code indentation. Wish it did though. :(
它看起来像在空间的命令之前出现的barfed以前的编译器的原因,根据:的
It looks like the reason is previous compilers barfed at spaces that appeared before the commands, according to: Indenting #defines
这篇关于可以视觉工作室自动缩进/格式的预处理指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!