src/vs/editor/browser/widget/codeEditorWidget.ts/CodeEditorWidget/_detachModel
class CodeEditorWidget:	private _detachModel(): ITextModel | null {
		if (!this._modelData) {
			return null;
		}
		const model = this._modelData.model;
		const removeDomNode = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null;

		this._modelData.dispose();
		this._modelData = null;

		this._domElement.removeAttribute('data-mode-id');
		if (removeDomNode && this._domElement.contains(removeDomNode)) {
			this._domElement.removeChild(removeDomNode);
		}
		if (this._bannerDomNode && this._domElement.contains(this._bannerDomNode)) {
			this._domElement.removeChild(this._bannerDomNode);
		}

		return model;
	}