src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts/MergeEditorModel/constructor
class MergeEditorModel:	constructor(
		readonly base: ITextModel,
		readonly input1: InputData,
		readonly input2: InputData,
		readonly resultTextModel: ITextModel,
		private readonly diffComputer: IMergeDiffComputer,
		private readonly options: { resetResult: boolean },
		public readonly telemetry: MergeEditorTelemetry,
		@IModelService private readonly modelService: IModelService,
		@ILanguageService private readonly languageService: ILanguageService,
		@IUndoRedoService private readonly undoRedoService: IUndoRedoService,
	) {
		super();

		this._register(keepAlive(this.modifiedBaseRangeResultStates));
		this._register(keepAlive(this.input1ResultMapping));
		this._register(keepAlive(this.input2ResultMapping));

		const initializePromise = this.initialize();

		this.onInitialized = this.onInitialized.then(async () => {
			await initializePromise;
		});

		initializePromise.then(() => {
			let shouldRecomputeHandledFromAccepted = true;
			this._register(
				autorunHandleChanges(
					'Merge Editor Model: Recompute State From Result',
					{
						handleChange: (ctx) => {
							if (ctx.didChange(this.modifiedBaseRangeResultStates)) {
								shouldRecomputeHandledFromAccepted = true;
							}
							return ctx.didChange(this.resultTextModelDiffs.diffs)
								// Ignore non-text changes as we update the state directly
								? ctx.change === TextModelDiffChangeReason.textChange
								: true;
						},
					},
					(reader) => {
						const states = this.modifiedBaseRangeResultStates.read(reader);
						if (!this.isUpToDate.read(reader)) {
							return;
						}
						const resultDiffs = this.resultTextModelDiffs.diffs.read(reader);
						transaction(tx => {
							/** @description Merge Editor Model: Recompute State */

							this.updateBaseRangeAcceptedState(resultDiffs, states, tx);

							if (shouldRecomputeHandledFromAccepted) {
								shouldRecomputeHandledFromAccepted = false;
								for (const [_range, observableState] of states) {
									const state = observableState.accepted.get();
									const handled = !(state.kind === ModifiedBaseRangeStateKind.base || state.kind === ModifiedBaseRangeStateKind.unrecognized);
									observableState.handledInput1.set(handled, tx);
									observableState.handledInput2.set(handled, tx);
								}
							}
						});
					}
				)
			);
		});
	}