extensions/markdown-language-features/src/languageFeatures/folding.ts/MdFoldingProvider/getHeaderFoldingRanges
class MdFoldingProvider:	private async getHeaderFoldingRanges(document: ITextDocument): Promise<vscode.FoldingRange[]> {
		const toc = await this.tocProvide.getForDocument(document);
		return toc.entries.map(entry => {
			let endLine = entry.sectionLocation.range.end.line;
			if (document.lineAt(endLine).isEmptyOrWhitespace && endLine >= entry.line + 1) {
				endLine = endLine - 1;
			}
			return new vscode.FoldingRange(entry.line, endLine);
		});
	}