src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts/DocumentMapping/getMappingContaining
class DocumentMapping:	public getMappingContaining(lineNumber: number, containingDirection: MappingDirection): LineRangeMapping {
		const mapTo = getOppositeDirection(containingDirection);
		const lastBefore = findLast(this.lineRangeMappings, r => r.getRange(containingDirection).startLineNumber <= lineNumber);
		if (lastBefore) {
			if (lastBefore.getRange(containingDirection).contains(lineNumber)) {
				return lastBefore;
			}
			const containingRange = new LineRange(lineNumber, 1);
			const mappedRange = new LineRange(
				lineNumber +
				lastBefore.getRange(mapTo).endLineNumberExclusive -
				lastBefore.getRange(containingDirection).endLineNumberExclusive,
				1
			);

			return containingDirection === MappingDirection.input
				? new LineRangeMapping(containingRange, mappedRange)
				: new LineRangeMapping(mappedRange, containingRange);
		}
		return new LineRangeMapping(
			new LineRange(lineNumber, 1),
			new LineRange(lineNumber, 1)
		);
	}