src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.ts/ComplexCustomWorkingCopyEditorHandler/_installHandler
class ComplexCustomWorkingCopyEditorHandler:	private _installHandler(): void {
		this._register(this._workingCopyEditorService.registerHandler({
			handles: workingCopy => workingCopy.resource.scheme === Schemas.vscodeCustomEditor,
			isOpen: (workingCopy, editor) => {
				if (workingCopy.resource.authority === 'jupyter-notebook-ipynb' && editor instanceof NotebookEditorInput) {
					try {
						const data = JSON.parse(workingCopy.resource.query);
						const workingCopyResource = URI.from(data);
						return isEqual(workingCopyResource, editor.resource);
					} catch {
						return false;
					}
				}
				if (!(editor instanceof CustomEditorInput)) {
					return false;
				}

				if (workingCopy.resource.authority !== editor.viewType.replace(/[^a-z0-9\-_]/gi, '-').toLowerCase()) {
					return false;
				}

				// The working copy stores the uri of the original resource as its query param
				try {
					const data = JSON.parse(workingCopy.resource.query);
					const workingCopyResource = URI.from(data);
					return isEqual(workingCopyResource, editor.resource);
				} catch {
					return false;
				}
			},
			createEditor: async workingCopy => {
				const backup = await this._workingCopyBackupService.resolve<CustomDocumentBackupData>(workingCopy);
				if (!backup?.meta) {
					throw new Error(`No backup found for custom editor: ${workingCopy.resource}`);
				}

				const backupData = backup.meta;
				if (backupData.viewType === 'jupyter.notebook.ipynb') {
					const editorAssociation = this._editorResolverService.getAssociationsForResource(URI.revive(backupData.editorResource));
					if (!editorAssociation.find(association => association.viewType === 'jupyter.notebook.ipynb')) {
						return NotebookEditorInput.create(this._instantiationService, URI.revive(backupData.editorResource), 'jupyter-notebook', { startDirty: !!backupData.backupId, _backupId: backupData.backupId, _workingCopy: workingCopy }) as any;
					}
				}

				const id = backupData.webview.id;
				const extension = reviveWebviewExtensionDescription(backupData.extension?.id, backupData.extension?.location);
				const webview = reviveWebview(this._webviewService, {
					id,
					origin: backupData.webview.origin,
					webviewOptions: restoreWebviewOptions(backupData.webview.options),
					contentOptions: restoreWebviewContentOptions(backupData.webview.options),
					state: backupData.webview.state,
					extension,
				});

				const editor = this._instantiationService.createInstance(CustomEditorInput, URI.revive(backupData.editorResource), backupData.viewType, id, webview, { backupId: backupData.backupId });
				editor.updateGroup(0);
				return editor;
			}
		}));
	}