lib/actions/select-item.js
function getNextItemRange(model, anchor, getItemRanges) {
	// Find HTML node for next selection
	let node = nodeForPoint(model, anchor.start, 'next');
	let range;

	// We might need to narrow down node context to find best token match
	while (node && !range) {
		range = getNextRange(getItemRanges(node), anchor);
		node = node.firstChild || nextSibling(node);
	}

	return range;
}
function getNextItemRange(model, anchor, getItemRanges) {
	// Find HTML node for next selection
	let node = nodeForPoint(model, anchor.start, 'next');
	let range;

	// We might need to narrow down node context to find best token match
	while (node && !range) {
		range = getNextRange(getItemRanges(node), anchor);
		node = node.firstChild || nextSibling(node);
	}

	return range;
}
function getNextItemRange ( model , anchor , getItemRanges ) { // Find HTML node for next selection let node = nodeForPoint ( model , anchor . start , 'next' ) ; let range ; // We might need to narrow down node context to find best token match while ( node && ! range ) { range = getNextRange ( getItemRanges ( node ) , anchor ) ; node = node . firstChild || nextSibling ( node ) ; } return range ; }
Returns selection range of useful code part of given `model` next to given
`anchor` range.
@param  {SyntaxModel} model
@param  {Range}       anchor
@param  {Function}    getItemRanges A function to retreive node ranges
@return {Range}
Returns selection range of useful code part of given model next to given anchor range .