extensions/emmet/src/selectItemStylesheet.ts/getSelectionFromNode
function getSelectionFromNode(document: vscode.TextDocument, node: Node | undefined): vscode.Selection | undefined {
	if (!node) {
		return;
	}

	const nodeToSelect = node.type === 'rule' ? (<Rule>node).selectorToken : node;
	return offsetRangeToSelection(document, nodeToSelect.start, nodeToSelect.end);
}