function setCollapseStateUp(foldingModel, doCollapse, lineNumbers) {
    const toToggle = [];
    for (const lineNumber of lineNumbers) {
        const regions = foldingModel.getAllRegionsAtLine(lineNumber, (region) => region.isCollapsed !== doCollapse);
        if (regions.length > 0) {
            toToggle.push(regions[0]);
        }
    }
    foldingModel.toggleCollapseState(toToggle);
}
Collapse or expand a region at the given locations. If the inner most region is already collapsed/expanded, uses the first parent instead.
@param doCollapse Whether to collapse or expand
@param lineNumbers the location of the regions to collapse or expand.