src/vs/workbench/services/editor/browser/editorResolverService.ts/EditorResolverService/moveExistingEditorForResource
class EditorResolverService:	private async moveExistingEditorForResource(
		resource: URI,
		viewType: string,
		targetGroup: IEditorGroup,
	): Promise<EditorInput | undefined> {
		const editorInfoForResource = this.findExistingEditorsForResource(resource, viewType);
		if (!editorInfoForResource.length) {
			return;
		}

		const editorToUse = editorInfoForResource[0];

		// We should only have one editor but if there are multiple we close the others
		for (const { editor, group } of editorInfoForResource) {
			if (editor !== editorToUse.editor) {
				const closed = await group.closeEditor(editor);
				if (!closed) {
					return;
				}
			}
		}

		// Move the editor already opened to the target group
		if (targetGroup.id !== editorToUse.group.id) {
			editorToUse.group.moveEditor(editorToUse.editor, targetGroup);
			return editorToUse.editor;
		}
		return;
	}