src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts/WorkspaceMergeEditorInputModel/confirmClose
class WorkspaceMergeEditorInputModel:	async confirmClose(inputModels: IMergeEditorInputModel[]): Promise<ConfirmResult> {
		const isMany = inputModels.length > 1;
		const someDirty = inputModels.some(m => m.isDirty.get());
		const someUnhandledConflicts = inputModels.some(m => m.model.hasUnhandledConflicts.get());
		if (someDirty) {
			const message = isMany
				? localize('workspace.messageN', 'Do you want to save the changes you made to {0} files?', inputModels.length)
				: localize('workspace.message1', 'Do you want to save the changes you made to {0}?', basename(inputModels[0].resultUri));
			const options: IDialogOptions = {
				detail:
					someUnhandledConflicts ?
						isMany
							? localize('workspace.detailN.unhandled', "The files contain unhandled conflicts. Your changes will be lost if you don't save them.")
							: localize('workspace.detail1.unhandled', "The file contains unhandled conflicts. Your changes will be lost if you don't save them.")
						: isMany
							? localize('workspace.detailN.handled', "Your changes will be lost if you don't save them.")
							: localize('workspace.detail1.handled', "Your changes will be lost if you don't save them.")
			};
			const actions: [string, ConfirmResult][] = [
				[
					someUnhandledConflicts
						? localize('workspace.saveWithConflict', 'Save with Conflicts')
						: localize('workspace.save', 'Save'),
					ConfirmResult.SAVE,
				],
				[localize('workspace.doNotSave', "Don't Save"), ConfirmResult.DONT_SAVE],
				[localize('workspace.cancel', 'Cancel'), ConfirmResult.CANCEL],
			];

			const { choice } = await this._dialogService.show(Severity.Info, message, actions.map(a => a[0]), { ...options, cancelId: actions.length - 1 });
			return actions[choice][1];

		} else if (someUnhandledConflicts && !this._storageService.getBoolean(StorageCloseWithConflicts, StorageScope.PROFILE, false)) {
			const message = isMany
				? localize('workspace.messageN.nonDirty', 'Do you want to close {0} merge editors?', inputModels.length)
				: localize('workspace.message1.nonDirty', 'Do you want to close the merge editor for {0}?', basename(inputModels[0].resultUri));
			const options: IDialogOptions = {
				detail:
					someUnhandledConflicts ?
						isMany
							? localize('workspace.detailN.unhandled.nonDirty', "The files contain unhandled conflicts.")
							: localize('workspace.detail1.unhandled.nonDirty', "The file contains unhandled conflicts.")
						: undefined
			};
			const actions: [string, ConfirmResult][] = [
				[
					someUnhandledConflicts
						? localize('workspace.closeWithConflicts', 'Close with Conflicts')
						: localize('workspace.close', 'Close'),
					ConfirmResult.SAVE,
				],
				[localize('workspace.cancel', 'Cancel'), ConfirmResult.CANCEL],
			];

			const { choice, checkboxChecked } = await this._dialogService.show(Severity.Info, message, actions.map(a => a[0]), {
				...options,
				cancelId: actions.length - 1,
				checkbox: { label: localize('noMoreWarn', "Don't ask again") }
			});

			if (checkboxChecked) {
				this._storageService.store(StorageCloseWithConflicts, true, StorageScope.PROFILE, StorageTarget.USER);
			}

			return actions[choice][1];
		} else {
			// This shouldn't do anything
			return ConfirmResult.SAVE;
		}
	}