extensions/emmet/src/selectItemStylesheet.ts/getSelectionFromProperty
function getSelectionFromProperty(document: vscode.TextDocument, node: Node | undefined, selectionStart: number, selectionEnd: number, selectFullValue: boolean, direction: string): vscode.Selection | undefined {
	if (!node || node.type !== 'property') {
		return;
	}
	const propertyNode = <Property>node;

	const propertyValue = propertyNode.valueToken.stream.substring(propertyNode.valueToken.start, propertyNode.valueToken.end);
	selectFullValue = selectFullValue ||
		(direction === 'prev' && selectionStart === propertyNode.valueToken.start && selectionEnd < propertyNode.valueToken.end);

	if (selectFullValue) {
		return offsetRangeToSelection(document, propertyNode.valueToken.start, propertyNode.valueToken.end);
	}

	let pos: number = -1;
	if (direction === 'prev') {
		if (selectionStart === propertyNode.valueToken.start) {
			return;
		}
		const selectionStartChar = document.positionAt(selectionStart).character;
		const tokenStartChar = document.positionAt(propertyNode.valueToken.start).character;
		pos = selectionStart > propertyNode.valueToken.end ? propertyValue.length :
			selectionStartChar - tokenStartChar;
	} else if (direction === 'next') {
		if (selectionEnd === propertyNode.valueToken.end &&
			(selectionStart > propertyNode.valueToken.start || !propertyValue.includes(' '))) {
			return;
		}
		const selectionEndChar = document.positionAt(selectionEnd).character;
		const tokenStartChar = document.positionAt(propertyNode.valueToken.start).character;
		pos = selectionEnd === propertyNode.valueToken.end ? -1 :
			selectionEndChar - tokenStartChar - 1;
	}


	const [newSelectionStartOffset, newSelectionEndOffset] = direction === 'prev' ? findPrevWord(propertyValue, pos) : findNextWord(propertyValue, pos);
	if (!newSelectionStartOffset && !newSelectionEndOffset) {
		return;
	}

	const tokenStart = document.positionAt(propertyNode.valueToken.start);
	const newSelectionStart = tokenStart.translate(0, newSelectionStartOffset);
	const newSelectionEnd = tokenStart.translate(0, newSelectionEndOffset);

	return new vscode.Selection(newSelectionStart, newSelectionEnd);
}