Search code examples
macosvisual-studio-codesymlink

vscode edit symlinks path


Is there any way to edit the symlink path in vscode?

For example in my git ui it shows the symlink path I use, "../../path"

It just opens the destination file when I click on it in the vscode explorer and it doesn't seem like there's a way to inspect and edit the actual path.


Solution

  • No, it looks like that isn't possible at the moment. The short answer is no, because it's not currently possible without customizations that (as far as I'm aware) don't exist yet and may be non-trivial to make.

    The long answer is, according to this similar question posted earlier (among other sources):

    1. The simplest way to edit a symink for you (assuming a Unix-like environment) would be to right-click it in the explorer, then select "Open in Integrated Terminal" and use something like ln -sfn source.ext link.ext within the terminal (-f overwrites & -n allows folders).
    2. If you're on Windows 10 (possibly 11 as well?) or earlier, you can use this shell extension to add a right-click option to edit symlink properties in a 'text editor' of sorts, as mentioned here.
    3. Something similar to the above extension probably exists or would be possible to make on Linux or even VS Code specifically, but would probably take some tinkering.
    4. Emacs' writable dired mode (wdired), shown in one of the answers linked to the previous question, seems to be the closest thing to what you're asking. Not possible in VS Code unless there's a custom extension or setup somewhere that I missed.