Hey,
I had installed code from pamac, and I was facing the same problem. I uninstalled the code from pamac, and then used snap to install VSCode, and now it’s working as intended. If anyone is facing the same problem, you might want to try snap for installing VSCode.