It does indeed do that from time to time, plus sometimes it is ultra-laggy before it highlights / helps you.
The most common fastest fix is just the whole Assets → Open C# Project from within Unity. And if you need more, here’s my standard blurb:
This may help you with intellisense and possibly other Visual Studio integration problems:
Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.
https://discussions.unity.com/t/778503
Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button
Also, this: https://discussions.unity.com/t/805330/7