src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts/TempFileMergeEditorInputModel/confirmClose
class TempFileMergeEditorInputModel:	public async confirmClose(inputModels: TempFileMergeEditorInputModel[]): Promise<ConfirmResult> {
		assertFn(
			() => inputModels.some((m) => m === this)
		);

		const someDirty = inputModels.some((m) => m.isDirty.get());
		let choice: number;
		if (someDirty) {
			const isMany = inputModels.length > 1;

			const message = isMany
				? localize('messageN', 'Do you want keep the merge result of {0} files?', inputModels.length)
				: localize('message1', 'Do you want keep the merge result of {0}?', basename(inputModels[0].model.resultTextModel.uri));

			const hasUnhandledConflicts = inputModels.some((m) => m.model.hasUnhandledConflicts.get());

			const options: IDialogOptions = {
				cancelId: 2,
				detail:
					hasUnhandledConflicts
						? isMany
							? localize('detailNConflicts', "The files contain unhandled conflicts. The merge results will be lost if you don't save them.")
							: localize('detail1Conflicts', "The file contains unhandled conflicts. The merge result will be lost if you don't save it.")
						: isMany
							? localize('detailN', "The merge results will be lost if you don't save them.")
							: localize('detail1', "The merge result will be lost if you don't save it.")
			};

			const actions: string[] = [
				hasUnhandledConflicts ? localize('saveWithConflict', "Save With Conflicts") : localize('save', "Save"),
				localize('discard', "Don't Save"),
				localize('cancel', "Cancel"),
			];

			choice = (await this.dialogService.show(Severity.Info, message, actions, options)).choice;
		} else {
			choice = 1;
		}

		if (choice === 2) {
			// cancel: stay in editor
			return ConfirmResult.CANCEL;
		} else if (choice === 0) {
			// save with conflicts
			await Promise.all(inputModels.map(m => m.accept()));
			return ConfirmResult.SAVE; // Save is a no-op anyway
		} else {
			// discard changes
			await Promise.all(inputModels.map(m => m._discard()));
			return ConfirmResult.DONT_SAVE; // Revert is a no-op
		}
	}