Reputation: 1945
When I use two systems, I expect both to be synced with the same set of extensions. In my case, the primary system I'm using is at work, and once I load my editor at home I'd expect any uninstalled or added extensions to eventually sync up.
This isn't happening.
I'd like to force sync the extensions to get this aligned, but there doesn't seem to be a way to do this in the settings sync UI.
My interim solution was to disable all extensions and then parsed the backed-up json with PowerShell to convert into code install-extension
commands. This didn't fix it though as it is still drifting.
My understanding is that key bindings were unique per platform, but extensions should be.
Is there anything I should check that prevents extensions from being synced with the built in Visual Studio Code Settings sync.
Note: I'm not using the
Shan.code-settings-sync
extension at this time, having migrated over in the last year to the built in sync solution. If I don't figure this out I might consider changing back over.
I'll update this as with my progress figuring it out as a wiki style post if I can resolve through the logs what's actually causing this type of drift.
Upvotes: 13
Views: 11158
Reputation: 1506
I too found that the built-in Vscode settings sync feature has bugs when syncing extensions. In the case of two clean vscode installs on two different machines, none of my extensions synced.
It seems that non existent extensions (perhaps the developer deleted their extension) can cause all extensions to inadvertently be 'blacklisted' in in the file lastSyncextensions.json
under the key "skippedExtensions":[]
. You can get to this file via the command Settings Sync : Open Local Backups Folder
. For me, all my extensions were listed to be skipped and thus no extensions were synced on a new install of vscode.
Transitory internet errors in syncing e.g. in log [settingssync] [error] Download: XHR failed
also causes extensions to be blacklisted in "skippedExtensions"
in the aforementioned lastSyncextensions.json
. This also sometimes causes vscode to broadcast that the extension which could not be download be removed by other machines running vscode (which sync using the same Github account).
Look in the vscode Settings Sync : Show Log
and look for the list of skipped extensions.
Once something is blacklisted - the question is how fix the situation.
Step 1:
Identify the extensions which no longer exist (search for them in the vscode extensions UI and if they don't appear, then they are the culprits). For me, they happened to be the first few entries in the "skippedExtensions"
list. Then add them to "settingsSync.ignoredExtensions"
of your settings.json
. For my situation, I added the entry:
"settingsSync.ignoredExtensions": [
"patrys.vscode-code-outline",
"gayanhewa.referenceshelper",
"ms-vscode-remote.remote-ssh-explorer"
],
Step 2 (brutal resync):
Now we need to re-sync. Turn off settings sync via the Settings Sync:Show Synced Data
/ "Synced Machines"
r.click on your machine and select "Turn off Settings Sync"
. This seems to work better than simply logging out of settings sync.
Now click on the normal vscode gear icon (bottom left) and sign in to settings sync. This prompted me like a fresh install, whether to merge, overwrite local etc. This time all the extensions came down OK.
Lets say you see some skipped extensions in your sync log (Settings Sync : Show Log
):
[2021-12-30 14:05:57.690] [settingssync] [info] Extensions: Updated last synchronized extensions. Skipped: ["sapos.yeoman-ui","tht13.html-preview-vscode","patbenatar.advanced-new-file","alexisvt.flutter-snippets","vscjava.vscode-java-pack","vscjava.vscode-java-dependency","vscjava.vscode-java-test","vscjava.vscode-maven","vscjava.vscode-java-debug","janisdd.vscode-edit-csv","mohd-akram.vscode-html-format","zjhmale.vscode-ag"].
which causes what seems to be a permanent blacklisting of these extensions on your machine in the file lastSyncextensions.json
under the key "skippedExtensions"
. How do you fix this?
You can get to
lastSyncextensions.json
via the commandSettings Sync : Open Local Backups Folder
and then open the file in vscode itself.
To get those extensions properly installed, I edited lastSyncextensions.json
and cleared the list - it now reads as "skippedExtensions":[]
.
Then I went to each particular extension that was previously skipped, using the vscode UI, and installed it. This should also re-install it on any other vscode machine which might have been affected.
Possibly, a simpler solution 2 (which I haven't tried) is don't bother with editing the file
lastSyncextensions.json
- simply do the brutal re-sync described in step 2 of my solution 1 above. Thus hopefully thelastSyncextensions.json
gets regenerated (as well as the problematic"skippedExtensions":
entry) and this time pray your internet connection is good and there are no download errors this time.
Upvotes: 4
Reputation: 1945
To manually restore, the option isn't contained in a context menu, but instead an icon that appears on hovering.
Use the restore icon here.
UPDATE: This solved my issue from what I can tell. I just opened VSCode on Windows and the extensions I installed a few hours ago on macOS are showing correctly there now.
Upvotes: 8