how to implement regions/code collapse in javascript

后端 未结 17 1670
灰色年华
灰色年华 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:47

    Region should work without changing settings

    //#region Optional Naming
        var x = 5 -0; // Code runs inside #REGION
        /* Unnecessary code must be commented out */
    //#endregion
    

    To enable collapsing comment area /**/

    /* Collapse this
    
    */
    

    Settings -> Search "folding" -> Editor: Folding Strategy -> From "auto" to "indentation".

    TAGS: Node.js Nodejs Node js Javascript ES5 ECMAScript comment folding hiding region Visual studio code vscode 2018 version 1.2+ https://code.visualstudio.com/updates/v1_17#_folding-regions

提交回复
热议问题