Gruntfuggly / global-config

Allows copying of shared config settings in vscode
MIT License
12 stars 4 forks source link

Symlinks don't seem to work for me. #6

Closed LaPeste closed 5 years ago

LaPeste commented 5 years ago

I can't get the symlinks to work. But all is fine without symlinks, which is:

"global-config.folder": "Y:\\development\\.vscode" // with only this it works, but it's only copied

// if added the following, those 3 files won't be copied/symlinked.
"global-config.links":
    [
        "c_cpp_properties.json",
        "launch.json",
        "tasks.json"
    ],

I'm on Windows 10 and at first I thought it was a lack of feature of the OS. But a quick web-search showed that win10 supports them. The only quirk seemed that it needs either the admin right or to be in developer mode. Because of this I tried launching VSCode as admin but with no luck. Still the same behaviour.

Any idea what's wrong?

Moreover, I saw that there are logs in the source code, but they never show in my VSCode's output window. Hence I wonder where console.log() go.

Thank you for the support.

Andrea

Gruntfuggly commented 5 years ago

The console.log output goes into the developer tools console (under the help menu). Have a look to see if there is anything in there.

It uses node's fs.symlinkSync which I assume should work cross platform, but it does sound like it needs developer mode to work.

LaPeste commented 5 years ago

Oh I didn't know about that console. But, as an improvement, would it not be more useful if the output went in the output window like most other extensions?

But anyway, as we expected, I get an error:

ERR EPERM: operation not permitted, symlink 'original path' -> 'destination path' at Object.symlinkSync (fs.js:883:3) ..... etc .....

I'm gonna look at how to set developer mode (I don't even know what it is, specifically).

LaPeste commented 5 years ago

Great! I can confirm that if "developer mode" is activated on Windows 10, then the error goes away and all works as expected.

Then I would suggest 2 things, one very fast and kinda necessary and the second just a nice to have:

  1. I think it's a good idea if you could mention in the readme what to do to get symbolic links to work under Windows 10 (I don't know if it applies also to previous versions of windows).
  2. As I suggested before, maybe getting the logs in the output window would be a lot more meaningful.

Beside that, thank you for the support and the great work. ;)

Gruntfuggly commented 5 years ago

I've updated the README.md and added an output channel. Thanks for your help.