extension.js
/**
 * Folds regions of default level and all their inner regions up to level 7.
 * @param resourceUri
 */
Folds regions of default level and all their inner regions up to level 7.
@param resourceUri
Folds regions of default level and all their inner regions up to level 7 . @param resourceUri
function foldLevelDefault(resourceUri) {
  const configuration = vscode.workspace.getConfiguration('fold', resourceUri);
  let level = configuration.get('level');
  if (level <= 0 || level > 7) {
    level = 2 
  }
  vscode.commands.executeCommand('editor.unfoldAll');
  for (let i = level; i <= 7; i++) {
    vscode.commands.executeCommand(`editor.foldLevel${i}`);
  }
}
function foldLevelDefault ( resourceUri ) { const configuration = vscode . workspace . getConfiguration ( 'fold' , resourceUri ) ; let level = configuration . get ( 'level' ) ; if ( level <= 0 || level > 7 ) { level = 2 } vscode . commands . executeCommand ( 'editor.unfoldAll' ) ; for ( let i = level ; i <= 7 ; i ++ ) { vscode . commands . executeCommand ( ` ${ i } ` ) ; } }
Folds regions of default level and all their inner regions up to level 7.
Folds regions of default level and all their inner regions up to level 7 .
// Extension default set in package.json