golf1052 / code-sync

Sync VSCode extensions using your favorite file synchronization service (OneDrive, Dropbox, Google Drive, etc.)
https://marketplace.visualstudio.com/items?itemName=golf1052.code-sync
MIT License
34 stars 3 forks source link

"settings.json" with comments crashes extension. #23

Closed sommd closed 7 years ago

sommd commented 7 years ago

Since the latest update it looks like the extension parses the JSON files to merge them instead of just copying. VSCode supports JSON comments however JavaScript's JSON does not. This causes the extension to crash:

[Extension Host] Here is the error stack:  SyntaxError: Unexpected token / in JSON at position 6
    at JSON.parse (<anonymous>)
    at LocalSettings.import (/home/david/.vscode/extensions/golf1052.code-sync-2.3.0/out/src/local-settings.js:12:29)
    at CodeSync.importSettings (/home/david/.vscode/extensions/golf1052.code-sync-2.3.0/out/src/cs.js:167:49)
    at /home/david/.vscode/extensions/golf1052.code-sync-2.3.0/out/src/extension.js:27:26
    at Generator.next (<anonymous>)
    at fulfilled (/home/david/.vscode/extensions/golf1052.code-sync-2.3.0/out/src/extension.js:4:58)
    at runMicrotasksCallback (internal/process/next_tick.js:58:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The only error message is in the developer console, and the extension's status indicator is stuck on "Importing settings".

golf1052 commented 7 years ago

This has been fixed in 2.3.1. Try upgrading and report back if this is still happening.

sommd commented 7 years ago

Still happening with 2.3.1. Exact same problem. Looks like you're still using the JSON object in local-settings.json.

golf1052 commented 7 years ago

Wow. Fixed (and tested) with 2.3.2. I'll leave this open this time if you have any problems again. Thanks for being patient.

golf1052 commented 7 years ago

Closing issue.