Solve this complex integral
$$\lim_{\varepsilon \rightarrow 0} \int_{-\infty}^{\infty} \frac{d\omega}{2\pi i}\frac{e^{-i\omega x}}{\omega + i\varepsilon}$$
Where $\varepsilon > 0$ and $x$ is real.
I tried to integrate it in a closed complex contour, apply Jordan's Lemma and solve it using Residue Theorem, but I could not apply Jordan's Lemma, it diverged.
For $x>0$, closing the contour in the lower-half plane, invoking Jordan's Lemma, and using the residue theorem, we find that
$$\begin{align} \frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega&=-2\pi i \frac{1}{2\pi i}\text{Res}\left(\frac{e^{-i\omega x}}{\omega +i\varepsilon}, \omega=-i\varepsilon \right)\\\\ &=-2\pi i \frac{1}{2\pi i}e^{-\epsilon x}\\\\ &=-e^{-\varepsilon x} \tag 1 \end{align}$$
For $x<0$, the integrand is analytic in and on the integration contour comprised of the real line and a semicircle in the upper-half plane centered at the origin with radius $R\to \infty$. Invoking Jordan's Lemma and applying Cauchy's Integral Theorem, we find that
$$\frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega=0 \tag 2$$
Putting $(1)$ and $(2)$ together yields
$$\lim_{\varepsilon\to 0^+}\frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega=-u(x)$$
where $u(x)$ is the unit step function.