src/vs/editor/browser/viewParts/minimap/minimap.ts/InnerMinimap/_renderSelectionLineHighlights
class InnerMinimap:	private _renderSelectionLineHighlights(
		canvasContext: CanvasRenderingContext2D,
		selections: Selection[],
		highlightedLines: ContiguousLineMap<boolean>,
		layout: MinimapLayout,
		lineHeight: number
	): void {
		if (!this._selectionColor || this._selectionColor.isTransparent()) {
			return;
		}

		canvasContext.fillStyle = this._selectionColor.transparent(0.5).toString();

		let y1 = 0;
		let y2 = 0;

		for (const selection of selections) {
			const startLineNumber = Math.max(layout.startLineNumber, selection.startLineNumber);
			const endLineNumber = Math.min(layout.endLineNumber, selection.endLineNumber);
			if (startLineNumber > endLineNumber) {
				// entirely outside minimap's viewport
				continue;
			}

			for (let line = startLineNumber; line <= endLineNumber; line++) {
				highlightedLines.set(line, true);
			}

			const yy1 = (startLineNumber - layout.startLineNumber) * lineHeight;
			const yy2 = (endLineNumber - layout.startLineNumber) * lineHeight + lineHeight;

			if (y2 >= yy1) {
				// merge into previous
				y2 = yy2;
			} else {
				if (y2 > y1) {
					// flush
					canvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);
				}
				y1 = yy1;
				y2 = yy2;
			}
		}

		if (y2 > y1) {
			// flush
			canvasContext.fillRect(MINIMAP_GUTTER_WIDTH, y1, canvasContext.canvas.width, y2 - y1);
		}
	}