Frequency combs have made optical metrology accessible to hundreds of laboratories worldwide and they have set new benchmarks in multi-species trace gas sensing for environmental, industrial and medical applications. However, current comb spectrometers privilege either frequency precision and sensitivity through interposition of a cw probe laser with limited tuning range, or spectral coverage and measurement time using the comb itself as an ultra-broadband probe. We overcome this restriction by introducing a comb-locked frequency-swept optical synthesizer that allows a continuous-wave laser to be swept in seconds over spectral ranges of several terahertz while remaining phase locked to an underlying frequency comb. This offers a unique degree of versatility, as the synthesizer can be either repeatedly scanned over a single absorption line to achieve ultimate precision and sensitivity, or swept in seconds over an entire rovibrational band to capture multiple species. The spectrometer enables us to determine line center frequencies with an absolute uncertainty of 30 kHz and at the same time to collect absorption spectra over more than 3 THz with state-of-the-art sensitivity of a few 10-10 cm-1. Beyond precision broadband spectroscopy, the proposed synthesizer is an extremely promising tool to force a breakthrough in terahertz metrology and coherent laser ranging.