版本更新 v1.70 在Insiders Build v1.70中,现在已经具备了真正隐藏任意代码行的功能和命令。该命令为: Create Manual Folding Range from Selection editor.createFoldingRangeFromSelection 默认情况下,它绑定到Ctrl+KCtrl+,。另外,Remove Manual Folding Ranges editor.removeManualFoldingRanges 默认情况下,它绑定在Ctrl+K Ctrl+.上。
现在,VS Code允许使用//#region和//#endregion标记任意代码块,以使它们可折叠。 // #region Hello console.log("Hello world") // #endregion