src/vs/workbench/browser/parts/editor/textResourceEditor.ts/AbstractTextResourceEditor/clearInput
class AbstractTextResourceEditor:	override clearInput(): void {

		// Keep editor view state in settings to restore when coming back
		this.saveTextResourceEditorViewState(this.input);

		// Clear Model
		const textEditor = this.getControl();
		if (textEditor) {
			textEditor.setModel(null);
		}

		super.clearInput();
	}