简体   繁体   English

如何在Visual Studio Code中对#region进行优先排序以进行折叠?

[英]How do I prioritize #regions for folding in Visual Studio Code?

I am trying to get used to using VSCode for C# development with Unity. 我正在尝试习惯将VSCode用于Unity的C#开发。 I have noticed that region folding is supported but it seems to be keyed off anything with a '#' symbol. 我注意到支持区域折叠,但是似乎可以用'#'符号将其折叠。 For example observe the following code snippet; 例如,观察以下代码片段;

#region FOO
    //Some code
#if BAR
    //Some conditional code
#endif
    //Bit more code
#endregion

In VSCode, if I was to use inlinging to folder the 'FOO' region it will only fold to the 'BAR' conditional. 在VSCode中,如果我要使用inlinging来文件夹“ FOO”区域,它将仅折叠为“ BAR”条件。

How can I make it so that VSCode treats regions as all encompassing for folding in the same manner that Visual Studio does? 如何使VSCode以与Visual Studio相同的方式将区域视为所有可折叠区域?

Turns out that this is a bug, along with a few others regarding folding. 事实证明,这是一个错误,还有一些其他有关折叠的错误。

See here: https://github.com/OmniSharp/omnisharp-vscode/issues/617 . 参见这里: https : //github.com/OmniSharp/omnisharp-vscode/issues/617

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM