function adjustFix(block, fix) {
	return {
		range: /** @type {Range} */ (
			fix.range.map(range => {
				// Advance through the block's range map to find the last
				// matching range by finding the first range too far and
				// then going back one.
				let i = 1;

				while (
					i < block.rangeMap.length &&
					block.rangeMap[i].js <= range
				) {
					i++;
				}

				// Apply the mapping delta for this range.
				return range + block.rangeMap[i - 1].md;
			})
		),
		text: fix.text.replace(/\n/gu, `\n${block.baseIndentText}`),
	};
}
Adjusts a fix in a code block.
@param {Block} block A code block.
@param {Fix} fix A fix to adjust.
@returns {Fix} The fix with adjusted ranges.