Reputation: 181
I recently switched from atom to VS Code, and there's one key feature that I can't seem to find.
Is it possible to display a symbolic link in the Visual Studio Code file explorer?
Upvotes: 18
Views: 44809
Reputation: 1006
This might be relevant only for git repos where VSCode is complaining symbolic linked files inside
the repo are not found, I fixed the error in VSCode by creating a symlink using the relative path.
Error message
Unable to open 'my-file.txt'
The editor could not be opened because the file was not found.
To create symlink
This way both github/gitlab and VSCode will be able to find the file
# Assuming you are now at the root of the git repo
# trying to create symlink for my-file.txt present in source/folder
cd path/to/source/folder
ln -sf my-file.txt ../../../relative/path/to/destination/folder/my-file.txt
The same ^ works for folders as well.
Upvotes: 0
Reputation: 1326376
Not only VSCode displays symlinks, but with VSCode 1.43 (Q1 2020), it will also display dangling symlinks.
See issue 90075:
- create symbolic links (either file or folder) and delete the target.
- Make sure the links still show up in the file explorer with their link decoration on the right hand side.
You can delete them, or open them and type to create them.
Upvotes: 1
Reputation: 8981
The February 2018 update for VSCode includes support for symbolic links.
The links appear as below:
For further info check this page: VSCode February 2018 update
Upvotes: 6
Reputation: 1382
There was an issue in GitHub to provide support for this which was resolved in February 2018 and included in the March 2018 release.
Upvotes: 2