Visual Studio 中的自定义代码折叠

Visual Studio 中的自定义代码折叠

是否有插件或选项可以使用注释来在 Visual Studio 中使用自定义代码折叠,而不是丑陋且非标准的 #pragma 区域?我知道在 vim 中是可能的。

我想使用类似

//{ My description of the region.
//}

代替

#pragma region Ugly and not compatible with other compilers. Will show unknown pragma warning
#pragma endregion

答案1

这取决于您在 VS 中定位的语言。在 C# 中,您可以使用“#region”,它看起来很简洁,可能就是您想要的。不幸的是(出于我不知道的原因),Microsoft 不支持 C++ 代码使用此功能,您必须使用“#pragma region”。

这里有更多与此相关的信息(与 VS 2013 相关): http://blogs.msdn.com/b/zainnab/archive/2013/07/12/visual-studio-2013-organize-your-code-with-named-regions.aspx

相关内容