Make sure that you (as an Ubuntu user account) are the owner of the folder and files you are editing in VSCode:
cd /path/to/my/files
chown -R $USER:$USER .
Note: If you are not the user, you might have to precede that with sudo:
sudo chown -R $USER:$USER .
(Note: full stop makes you the owner of the files in the parent directory)