how to implement regions/code collapse in javascript

后端 未结 17 1673
灰色年华
灰色年华 2020-11-28 21:01

How can you implement regions a.k.a. code collapse for JavaScript in Visual Studio?

If there are hundreds of lines in javascript, it\'ll be more understandable using

17条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 21:35

    This is now natively in VS2017:

    //#region fold this up
    
    //#endregion
    

    Whitespace between the // and # does not matter.

    I do not know what version this was added in, as I cannot find any mention of it in the changelogs. I am able to use it in v15.7.3.

提交回复
热议问题