4. The graph of the parabola $y=x^{2}+x+p(p \neq 0)$ intersects the $x$-axis at one point with the $x$-coordinate $p$. Then, the coordinates of the vertex of the parabola are ( ).
(A) $(0,-2)$
(B) $\left(\frac{1}{2},-\frac{9}{4}\right)$
(C) $\left(-\frac{1}{2}, \frac{9}{4}\right)$
(D) $\left(-\frac{1}{2},-\frac{9}{4}\right)$
4.D.

From the problem, we get $p^{2}+p+p=0$.
Solving, we get $p_{1}=-2, p_{2}=0$ (discard).
When $p=-2$, the parabola is $y=x^{2}+x-2$.
Therefore, the vertex coordinates are $\left(-\frac{1}{2},-\frac{9}{4}\right)$.