microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 290 forks source link

Files replaced with symlinks under WSL are not being detected as changed by VScode run from WSL #3725

Open fnickels opened 4 years ago

fnickels commented 4 years ago

Steps to Reproduce:

# steps run from WSL terminal  launched in an empty directory
git init
mkdir subdir
ls > basefile.txt
git add --all
git commit -a -m initial-commit
cp basefile.txt subdir
code .
# Should now have both VScode and the terminal screen open tied to the same directory
## Visual code reports one file modified as expected
git status
## shows the untracked file in `subdir`
git add --all
git commit -a -m 2nd-commit
## the previous two commands run successfully
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
ls > 2ndfile.txt
git status
##  shows new untracked file
## VScode shows the new file, but does not list it as new
## if you hit refresh in VScode the file shows up as a new file for git
git add --all
git commit -a -m 3rd-commit
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
cd subdir/
ln -s ../2ndfile.txt .
ls -la
git status
## shows the untracked file in `subdir`
## But in VScode the file does not show up in the Explorer
ls > 3rdfile.txt
git status
## now shows two untracked file in `subdir`
## if you hit refresh in VScode both files show up in Explorer and as new files for git
git add --all
git commit -a -m 4th-commit
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
rm *.txt
git status
## shows 3 files in `subdir` tagged for deletion
## if you hit refresh in VScode the same changes show up there
ln -s ../*.txt .
git status
## Shows as expected:
###        deleted:    3rdfile.txt
###        typechange: basefile.txt
## Hitting refresh in VScode only shows the deletion of '/3rdfile.txt' and is missing the type change on 'basefile.txt'
## if you commit the change from vscode it shows a clean working directory
git status
## But this still shows
###        typechange: basefile.txt

The bug is the fact that a symlink is not detected as a change, while a new symlink does show up as a change.

It would also be nice if the VSCode explorer and git integration detected the changes to the underlying file structure more dynamically. VSCode appears to do a much better job of this when using the Native Windows version on top of the native Windows file system. But when doing cross-platform development where the code base uses symlinks and/or illegal Windows characters in file and directory names (ie: ':' character) this forces you to use the WSL filesystem and VSCode in WSL.

Does this issue occur when all extensions are disabled?: Yes/No - Did not test

vscodebot[bot] commented 4 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

fnickels commented 4 years ago

I should have also added it would be super nice to be able to create symlinks directly from the VSCode UI instead of having to step out to a WSL terminal.