src/vs/workbench/contrib/notebook/browser/notebookEditor.ts/NotebookEditor/setInput
class NotebookEditor:	override async setInput(input: NotebookEditorInput, options: INotebookEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
		clearMarks(input.resource);
		mark(input.resource, 'startTime');
		const group = this.group!;

		this.inputListener.value = input.onDidChangeCapabilities(() => this.onDidChangeInputCapabilities(input));

		this._saveEditorViewState(this.input);

		this._widgetDisposableStore.clear();

		// there currently is a widget which we still own so
		// we need to hide it before getting a new widget
		if (this._widget.value) {
			this._widget.value.onWillHide();
		}

		this._widget = this.instantiationService.invokeFunction(this._notebookWidgetService.retrieveWidget, group, input);
		this._widgetDisposableStore.add(this._widget.value!.onDidChangeModel(() => this._onDidChangeModel.fire()));

		if (this._dimension) {
			this._widget.value!.layout(this._dimension, this._rootElement);
		}

		// only now `setInput` and yield/await. this is AFTER the actual widget is ready. This is very important
		// so that others synchronously receive a notebook editor with the correct widget being set
		await super.setInput(input, options, context, token);
		const model = await input.resolve();
		mark(input.resource, 'inputLoaded');

		// Check for cancellation
		if (token.isCancellationRequested) {
			return undefined;
		}

		if (model === null) {
			this._notificationService.prompt(
				Severity.Error,
				localize('fail.noEditor', "Cannot open resource with notebook editor type '{0}', please check if you have the right extension installed or enabled.", input.viewType),
				[{
					label: localize('fail.reOpen', "Reopen file with VS Code standard text editor"),
					run: async () => {
						await this._editorService.openEditor({ resource: input.resource, forceFile: true, options: { ...options, override: EditorOverride.DISABLED } });
					}
				}]
			);
			return;
		}



		const viewState = this._loadNotebookEditorViewState(input);

		this._widget.value?.setParentContextKeyService(this._contextKeyService);
		await this._widget.value!.setModel(model.notebook, viewState);
		const isReadOnly = input.hasCapability(EditorInputCapabilities.Readonly);
		await this._widget.value!.setOptions({ ...options, isReadOnly });
		this._widgetDisposableStore.add(this._widget.value!.onDidFocus(() => this._onDidFocusWidget.fire()));

		this._widgetDisposableStore.add(this._editorDropService.createEditorDropTarget(this._widget.value!.getDomNode(), {
			containsGroup: (group) => this.group?.id === group.id
		}));

		mark(input.resource, 'editorLoaded');

		type WorkbenchNotebookOpenClassification = {
			scheme: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			ext: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			viewType: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			extensionActivated: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			inputLoaded: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			webviewCommLoaded: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			customMarkdownLoaded: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
			editorLoaded: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
		};

		type WorkbenchNotebookOpenEvent = {
			scheme: string;
			ext: string;
			viewType: string;
			extensionActivated: number;
			inputLoaded: number;
			webviewCommLoaded: number;
			customMarkdownLoaded: number;
			editorLoaded: number;
		};

		const perfMarks = getAndClearMarks(input.resource);

		if (perfMarks) {
			const startTime = perfMarks['startTime'];
			const extensionActivated = perfMarks['extensionActivated'];
			const inputLoaded = perfMarks['inputLoaded'];
			const webviewCommLoaded = perfMarks['webviewCommLoaded'];
			const customMarkdownLoaded = perfMarks['customMarkdownLoaded'];
			const editorLoaded = perfMarks['editorLoaded'];

			if (
				startTime !== undefined
				&& extensionActivated !== undefined
				&& inputLoaded !== undefined
				&& webviewCommLoaded !== undefined
				&& customMarkdownLoaded !== undefined
				&& editorLoaded !== undefined
			) {
				this.telemetryService.publicLog2<WorkbenchNotebookOpenEvent, WorkbenchNotebookOpenClassification>('notebook/editorOpenPerf', {
					scheme: model.notebook.uri.scheme,
					ext: extname(model.notebook.uri),
					viewType: model.notebook.viewType,
					extensionActivated: extensionActivated - startTime,
					inputLoaded: inputLoaded - startTime,
					webviewCommLoaded: webviewCommLoaded - startTime,
					customMarkdownLoaded: customMarkdownLoaded - startTime,
					editorLoaded: editorLoaded - startTime
				});
			}
		}
	}