WSL v.1 -- VSCode v1.40.1 (using \'Remote - WSL\' extension 40.3)
How to open a root-owned file for edit using sudo and VSCode? (without running as root)
You can own the file you want to edit, then give it back the ownership afterwards
sudo chown myuser /path/to/file code /path/to/file sudo chown root /path/to/file