extensions/emmet/src/toggleComment.ts/toggleCommentHTML
function toggleCommentHTML(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): vscode.TextEdit[] {
	const selectionStart = selection.isReversed ? selection.active : selection.anchor;
	const selectionEnd = selection.isReversed ? selection.anchor : selection.active;
	const selectionStartOffset = document.offsetAt(selectionStart);
	const selectionEndOffset = document.offsetAt(selectionEnd);
	const documentText = document.getText();

	const startNode = getHtmlFlatNode(documentText, rootNode, selectionStartOffset, true);
	const endNode = getHtmlFlatNode(documentText, rootNode, selectionEndOffset, true);

	if (!startNode || !endNode) {
		return [];
	}

	if (sameNodes(startNode, endNode) && startNode.name === 'style'
		&& startNode.open && startNode.close
		&& startNode.open.end < selectionStartOffset
		&& startNode.close.start > selectionEndOffset) {
		const buffer = ' '.repeat(startNode.open.end) +
			documentText.substring(startNode.open.end, startNode.close.start);
		const cssRootNode = parseStylesheet(buffer);
		return toggleCommentStylesheet(document, selection, cssRootNode);
	}

	const allNodes: Node[] = getNodesInBetween(startNode, endNode);
	let edits: vscode.TextEdit[] = [];

	allNodes.forEach(node => {
		edits = edits.concat(getRangesToUnCommentHTML(node, document));
	});

	if (startNode.type === 'comment') {
		return edits;
	}


	edits.push(new vscode.TextEdit(offsetRangeToVsRange(document, allNodes[0].start, allNodes[0].start), startCommentHTML));
	edits.push(new vscode.TextEdit(offsetRangeToVsRange(document, allNodes[allNodes.length - 1].end, allNodes[allNodes.length - 1].end), endCommentHTML));

	return edits;
}