A.R.C
A.R.C

Reputation: 181

Display symbolic links in Visual Studio Code

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

Answers (4)

Ranjith Kumar Cheguri
Ranjith Kumar Cheguri

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

  • first move to the actual directory where the file exists and then
  • use the relative path to create the 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

VonC
VonC

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.

Screenshot 2020-02-05 at 16 12 10 -- https://user-images.githubusercontent.com/900690/73854135-49af2080-4832-11ea-8c85-920280d36339.png

Upvotes: 1

Mwiza
Mwiza

Reputation: 8981

The February 2018 update for VSCode includes support for symbolic links.

The links appear as below:

enter image description here

For further info check this page: VSCode February 2018 update

Upvotes: 6

Ryan
Ryan

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

Related Questions