The mechanism and regioselectivity of gold(I) or platinum(II) catalyzed intramolecular hydroarylation to pyrrolopyridinones and pyrroloazepinones.