src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts/BulkEditPane/_openElementAsEditor
class BulkEditPane:	private async _openElementAsEditor(e: IOpenEvent<BulkEditElement | undefined>): Promise<void> {
		type Mutable<T> = {
			-readonly [P in keyof T]: T[P]
		};

		const options: Mutable<ITextEditorOptions> = { ...e.editorOptions };
		let fileElement: FileElement;
		if (e.element instanceof TextEditElement) {
			fileElement = e.element.parent;
			options.selection = e.element.edit.textEdit.textEdit.range;

		} else if (e.element instanceof FileElement) {
			fileElement = e.element;
			options.selection = e.element.edit.textEdits[0]?.textEdit.textEdit.range;

		} else {
			// invalid event
			return;
		}

		const previewUri = this._currentProvider!.asPreviewUri(fileElement.edit.uri);

		if (fileElement.edit.type & BulkFileOperationType.Delete) {
			// delete -> show single editor
			this._editorService.openEditor({
				label: localize('edt.title.del', "{0} (delete, refactor preview)", basename(fileElement.edit.uri)),
				resource: previewUri,
				options
			});

		} else {
			// rename, create, edits -> show diff editr
			let leftResource: URI | undefined;
			try {
				(await this._textModelService.createModelReference(fileElement.edit.uri)).dispose();
				leftResource = fileElement.edit.uri;
			} catch {
				leftResource = BulkEditPreviewProvider.emptyPreview;
			}

			let typeLabel: string | undefined;
			if (fileElement.edit.type & BulkFileOperationType.Rename) {
				typeLabel = localize('rename', "rename");
			} else if (fileElement.edit.type & BulkFileOperationType.Create) {
				typeLabel = localize('create', "create");
			}

			let label: string;
			if (typeLabel) {
				label = localize('edt.title.2', "{0} ({1}, refactor preview)", basename(fileElement.edit.uri), typeLabel);
			} else {
				label = localize('edt.title.1', "{0} (refactor preview)", basename(fileElement.edit.uri));
			}

			this._editorService.openEditor({
				original: { resource: leftResource },
				modified: { resource: previewUri },
				label,
				description: this._labelService.getUriLabel(dirname(leftResource), { relative: true }),
				options
			}, e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
		}
	}