Try opening the directory in vscode through terminal. This worked for me.
use command: code path/to/directory
Things I tried but did not work: 1. resetting settings 2. reinstalling vscode 3. restarting it XD
Things I should have tried: Restarting the computer =)
this might happen due to permission issues which might be resolved if opened through terminal.