src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts/ComplexNotebookEditorModel/saveAs
class ComplexNotebookEditorModel:	async saveAs(targetResource: URI): Promise<EditorInput | undefined> {

		if (!this.isResolved()) {
			return undefined;
		}

		this._logService.debug(`[notebook editor model] saveAs - enter`, this.resource.toString(true));
		const result = await this._assertStat();

		if (result === 'none') {
			return undefined;
		}

		if (result === 'revert') {
			await this.revert();
			return undefined;
		}

		const success = await this._contentProvider.saveAs(this.notebook.uri, targetResource, CancellationToken.None);
		this._logService.debug(`[notebook editor model] saveAs - document saved, start updating file stats`, this.resource.toString(true), success);
		this._lastResolvedFileStat = await this._resolveStats(this.resource);
		if (!success) {
			return undefined;
		}
		this.setDirty(false);
		this._onDidSave.fire({});
		return this._instantiationService.createInstance(NotebookEditorInput, targetResource, this.viewType, {});
	}