"use strict" ; import * as vscode from "vscode" ; import * as config from "./../config/Configuration" ; import * as r from "./CustomRegions" ; export class MyFoldingRangeProvider implements vscode . FoldingRangeProvider { private _configurationService : config . ConfigurationService ; public get configurationService ( ) { return this . _configurationService ; } public set configurationService ( value ) { if ( this . _configurationService !== value ) { this . _configurationService = value ; } } constructor ( config ) { this . _configurationService = config ; } provideFoldingRanges ( document , context , token ) { const regionProvider = new r . RegionProvider ( this . configurationService ) ; var regions = regionProvider . getRegions ( document ) ; var crs = [ ] ; for ( let region of regions . completedRegions ) { var foldingRange = new vscode . FoldingRange ( region . lineStart , < number > region . lineEnd , vscode . FoldingRangeKind . Region ) ; crs . push ( foldingRange ) ; } return crs ; } }