function setCollapseStateLevelsUp(foldingModel, doCollapse, levels, lineNumbers) {
    const toToggle = [];
    for (const lineNumber of lineNumbers) {
        const regions = foldingModel.getAllRegionsAtLine(lineNumber, (region, level) => region.isCollapsed !== doCollapse && level <= levels);
        toToggle.push(...regions);
    }
    foldingModel.toggleCollapseState(toToggle);
}
Collapse or expand the regions at the given locations including all parents.
@param doCollapse Whether to collapse or expand
@param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels.
@param lineNumbers the location of the regions to collapse or expand.