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

Unexpected token ) #28

Open Mordef opened 6 years ago

Mordef commented 6 years ago

VSCode version: 1.18.1 CodeSync version: 2.5.0 CodeSync log: no logfile

Issue: Export Extensions works Export Settings and All got Error: Unexpected token ) Running the contributed command:'codeSync.exportSettings' failed.

After reinstall: command 'codeSync.setSyncPath' not found command 'codeSync.exportSettings' not found command 'codeSync.exportExtensions' not found

Mordef commented 6 years ago

Have try with version 2.5.1 to get the log. I try to Export Extension and got: command 'codeSync.exportExtensions' not found

Logfile said: " 2017-11-17T07:08:12.645Z - Importing settings 2017-11-17T07:08:12.645Z - Failed to import settings. Could not find settings.json at D:\OneDrive\VSCode\settings.json. Giving up."

Import when i try export?

settings.ts 2017-11-17T07:07:58.539Z - Creating settings with internal settings.json path and external extensions.json path: C:\Users\waack.vscode\extensions\golf1052.code-sync-2.5.1\settings.json, extensions.json. helpers.ts 2017-11-17T07:07:58.727Z - Found code version: 1.18.1 929bacba01ef658b873545e26034d1a8067445e9 . cs.ts 2017-11-17T07:07:58.727Z - Checking settings 2017-11-17T07:07:58.758Z - Could not find settings in C:\Users\waack.vscode\extensions\golf1052.code-sync-2.5.1\settings.json. Creating... 2017-11-17T07:08:12.640Z - External sync path is now D:\OneDrive\VSCode. 2017-11-17T07:08:12.640Z - Setting external extensions path as D:\OneDrive\VSCode\extensions.json. 2017-11-17T07:08:12.640Z - Done checking settings. 2017-11-17T07:08:12.640Z - External sync directory: D:\OneDrive\VSCode 2017-11-17T07:08:12.645Z - Importing settings 2017-11-17T07:08:12.645Z - Failed to import settings. Could not find settings.json at D:\OneDrive\VSCode\settings.json. Giving up. 2017-11-17T07:08:12.645Z - Importing keybindings 2017-11-17T07:08:12.645Z - Failed to import keybindings. Could not find keybindings.json at D:\OneDrive\VSCode\keybindings.json. Giving up. 2017-11-17T07:08:12.646Z - Importing snippets 2017-11-17T07:08:12.646Z - Failed to import snippets. Could not find snippets directory at D:\OneDrive\VSCode\snippets. Giving up. 2017-11-17T07:08:12.646Z - Importing extensions

opticon454 commented 6 years ago

Installed this plugin today and I'm getting the same error. Extensions.json exports but nothing else will and I get "Running the contributed command:'codeSync.exportSettings' failed." when trying '> CodeSync: Export All"

Running the Import task generators file not found error. Even tried pre-populating the files, changing a setting and then running an export and nothing happens.

Code Output settings.ts 2018-02-09T02:03:37.043Z - Creating settings with internal settings.json path and external extensions.json path: C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\settings.json, extensions.json. helpers.ts 2018-02-09T02:03:37.389Z - Found code version: 1.20.0 c63189deaa8e620f650cc28792b8f5f3363f2c5b x64 . cs.ts 2018-02-09T02:03:37.389Z - Checking settings 2018-02-09T02:03:37.430Z - Could not find settings in C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\settings.json. Creating... 2018-02-09T02:03:41.748Z - External sync path is now C:\Git\Management\VSCode\CodeSync. 2018-02-09T02:03:41.748Z - Setting external extensions path as C:\Git\Management\VSCode\CodeSync\extensions.json. 2018-02-09T02:03:41.749Z - Done checking settings. 2018-02-09T02:03:41.749Z - External sync directory: C:\Git\Management\VSCode\CodeSync 2018-02-09T02:03:41.755Z - Importing settings 2018-02-09T02:03:41.756Z - Failed to import settings. Could not find settings.json at C:\Git\Management\VSCode\CodeSync\settings.json. Giving up. 2018-02-09T02:03:41.756Z - Importing keybindings 2018-02-09T02:03:41.756Z - Failed to import keybindings. Could not find keybindings.json at C:\Git\Management\VSCode\CodeSync\keybindings.json. Giving up. 2018-02-09T02:03:41.757Z - Importing snippets 2018-02-09T02:03:41.757Z - Failed to import snippets. Could not find snippets directory at C:\Git\Management\VSCode\CodeSync\snippets. Giving up. 2018-02-09T02:03:41.758Z - Importing extensions 2018-02-09T02:03:41.759Z - Finished importing extensions. 2018-02-09T02:03:41.759Z - Exporting extensions 2018-02-09T02:03:41.765Z - Finished exporting extensions

Log (Extension Host) [2018-02-09 10:04:01.840] [exthost1] [error] SyntaxError: Unexpected token } at unexpected (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\json-parser\index.js:121:9) at expect (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\json-parser\index.js:115:5) at parse_object (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\json-parser\index.js:140:5) at walk (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\json-parser\index.js:91:14) at Object.parse (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\json-parser\index.js:55:16) at Object.parse (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\node_modules\comment-json\lib\parse.js:8:17) at Object.parseJson (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\out\src\helpers.js:271:17) at LocalSettings.export (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\out\src\local-settings.js:29:32) at CodeSync.exportSettings (C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\out\src\cs.js:208:45) at C:\Users*PROFILE.vscode\extensions\golf1052.code-sync-2.5.3\out\src\extension.js:56:22 codeSync.exportSettings

opticon454 commented 6 years ago

So after redoing my settings.kson file for another reason CodeSync seems to be working now. VSC didn't pick up that I had a ',' on the last line setting when it shouldn't be there and CodeSync was failing because of it

k4mrul commented 6 years ago

I am also facing the same problem. Can anyone find the fix?

asifm commented 6 years ago

As @opticon454 said, CodeSync fails when there's a trailing comma in the User Settings json file. That is, the last line in the settings file has a comma at the end. Remove this and then the extension works without error (that's what happened in my case anyway).

Korkman commented 5 years ago

Same applies to keybindings.json