Case $1$
In order to evaluate the Dirichlet integral $$I_1=\int\limits_{-\infty}^{+\infty}\frac{\sin x}{x}dx=\pi,$$ we can consider another integral $$I_1^\prime=\oint_C\frac{e^{iz}}{z}.$$ Now, we can choose a semicircular contour C of radius $R$ to close in the upper half-plane and make another small semicircular indentation around $z=0$ (of radius $\varepsilon$) to avoid the pole at $z=0$. In this problem, the little semicircle about $z=0$ does contribute and it cannot be neglected.
Case $2$
Now consider the integral $$I_2=\int\limits_{-\infty}^{+\infty}\frac{e^{ix}}{x-x_0}=2\pi i e^{ix_0}$$ with $x_0>0$. Let us make it a closed contour integral by regarding $x$ to be complex, choosing a large semicircle enclosed in the upper half-plane and a smaller semicircular indentation (of radius $\varepsilon$) in the lower half-plane about $x=x_0$. If we want to do this using residue theorem, picking up the residue at $x=x_0$, the small semicircular contribution does not matter.
Why does the smaller semicircular contribution matter in the first case but not in the second case?