FWIW Just experienced this, and the answers here helped.
In my case, I had installed the STM32 Cube IDE extension, which doesnt play nicely with the microsoft Intellilsense, and asked if I wanted to disable it. I said yes, but didnt realise it disabled it as USER and not workspace etc - so it broke all the other projects.
Live and learn I guess :-)