src/vs/base/browser/ui/list/listWidget.ts/isMonacoEditor
export function isMonacoEditor(e: HTMLElement): boolean {
	if (e.classList.contains('monaco-editor')) {
		return true;
	}

	if (e.classList.contains('monaco-list')) {
		return false;
	}

	if (!e.parentElement) {
		return false;
	}

	return isMonacoEditor(e.parentElement);
}