  Understanding the origin of the astonishing diversity of exoplanets is a key
question for the coming decades. ALMA has revolutionized our view of the dust
emission from protoplanetary disks, demonstrating the prevalence of ring and
spiral structures that are likely sculpted by young planets in formation. To
detect kinematic signatures of these protoplanets and to probe the chemistry of
their gas accretion reservoir will require the imaging of molecular spectral
line emission at high angular and spectral resolution. However, the current
sensitivity of ALMA limits these important spectral studies to only the nearest
protoplanetary disks. Although some promising results are emerging, including
the identification of the snowlines of a few key molecules and the first
attempt at detecting a protoplanet's spiral wake, it is not yet possible to
search for these important signatures in a population of disks in diverse
environments and ages. Harnessing the tremendous power of (sub)mm observations
to pinpoint and characterize the chemistry of planets in formation will require
a major increase of ALMA's spectral sensitivity (5-10x), increase in
instantaneous bandwidth (2x) at high spectral resolution, and improved angular
resolution (2x) in the 2030 era.
