src/vs/workbench/services/editor/browser/editorService.ts/EditorService/doResolveEditor
class EditorService:	private async doResolveEditor(editor: IEditorInputWithOptions | IUntypedEditorInput, preferredGroup?: OpenInEditorGroup): Promise<[ReturnedOverride, IEditorGroup | undefined, IEditorOptions | undefined]> {

		// Typed: convert to untyped to be able to resolve the override
		let untypedEditor: IUntypedEditorInput | undefined = undefined;
		if (isEditorInputWithOptions(editor)) {
			untypedEditor = editor.editor.toUntyped(undefined, UntypedEditorContext.Default);
			if (!untypedEditor) {
				const [group, activation] = this.findTargetGroup(editor.editor, editor.options);

				return [OverrideStatus.NONE, group, { ...editor.options, activation }]; // unsupported untyped editor
			}

			// Preserve original options
			untypedEditor.options = editor.options ?? untypedEditor.options;
		}

		// Untyped: take as is
		else {
			untypedEditor = editor;
		}

		// We need a `override` for the untyped editor if it is
		// not there so we call into the editor override service
		let conflictingDefaults = false;
		if (typeof untypedEditor.options?.override !== 'string') {
			const populatedInfo = await this.editorOverrideService.populateEditorId(untypedEditor);
			if (!populatedInfo) {
				return [OverrideStatus.ABORT, undefined, undefined]; // we could not resolve the editor id
			}

			conflictingDefaults = populatedInfo.conflictingDefault;
		}

		// Find the target group for the editor
		const [group, activation] = this.findTargetGroup(untypedEditor, preferredGroup);

		// Adjust options based on group activation if any
		if (activation) {
			untypedEditor.options = { ...untypedEditor.options, activation };
		}

		return [await this.editorOverrideService.resolveEditorInput(untypedEditor, group, conflictingDefaults), group, untypedEditor.options];
	}