src/vs/workbench/services/hover/browser/hoverWidget.ts/HoverWidget/adjustHoverMaxHeight
class HoverWidget:	private adjustHoverMaxHeight(target: TargetRect): void {
		let maxHeight = window.innerHeight / 2;

		// When force position is enabled, restrict max height
		if (this._forcePosition) {
			const padding = (this._hoverPointer ? Constants.PointerSize : 0) + Constants.HoverBorderWidth;
			if (this._hoverPosition === HoverPosition.ABOVE) {
				maxHeight = Math.min(maxHeight, target.top - padding);
			} else if (this._hoverPosition === HoverPosition.BELOW) {
				maxHeight = Math.min(maxHeight, window.innerHeight - target.bottom - padding);
			}
		}

		// Make sure not to accidentally enlarge the hover when setting a maxHeight for it
		maxHeight = Math.min(maxHeight, this._hover.containerDomNode.clientHeight);

		this._hover.containerDomNode.style.maxHeight = `${maxHeight}px`;
		if (this._hover.contentsDomNode.clientHeight > maxHeight) {
			this._hover.contentsDomNode.style.height = `${maxHeight}px`;
		}
		if (this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) {
			// Add padding for a vertical scrollbar
			const extraRightPadding = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
			if (this._hover.contentsDomNode.style.paddingRight !== extraRightPadding) {
				this._hover.contentsDomNode.style.paddingRight = extraRightPadding;
			}
		}
	}