【问题标题】:VSCode Synchronize Error With Output Content in the file is not validVSCode 与文件中的输出内容同步错误无效
【发布时间】:2022-11-08 21:55:40
【问题描述】:

这是我第一次使用 GitHub 账号同步 VSCode。但是当我尝试同步时(登录后),我遇到了这样的错误:

[2022-03-07 17:01:16.719] [settingssync] [info] Using settings sync service https://vscode-sync.trafficmanager.net/
[2022-03-07 17:01:16.719] [settingssync] [info] Auto Sync is disabled.
[2022-03-07 17:04:41.983] [settingssync] [info] Did reset the local sync state.
[2022-03-07 17:04:43.688] [settingssync] [error] LocalInvalidContent (UserDataSyncError) syncResource:keybindings operationId:unknown: Unable to sync keybindings because the content in the file is not valid. Please open the file and correct it.
    at y.generateSyncPreview (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:91833)
    at async y.doGenerateSyncResourcePreview (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:56502)
[2022-03-07 17:04:43.693] [settingssync] [info] Settings: Stopped synchronizing settings.
[2022-03-07 17:04:43.697] [settingssync] [info] Did reset the local sync state.

你知道我该怎么做吗?因为解释不清楚。我试图在路径上按住 CMD 的同时单击并创建一个新文件,但它不起作用。谢谢

【问题讨论】:

  • 也许您在一行之后错过了,。基本上,检查您的settings.json 文件中是否包含有效的JSON

标签: visual-studio-code synchronization


【解决方案1】:

在我的情况下,~/.config/Code/User/keybindings.json 中错过了]。我注意到此文件夹中的所有 json 文件都必须经过审查才能成为正确的 json。

前:

后:

【讨论】:

    【解决方案2】:

    您的 settings.json 文件中一定有一些语法错误。如果没有发现任何错误或不理解 JSON 文件,请转到 https://jsonlint.com/ 并检查您的设置文件 json 文本并进行验证。

    【讨论】:

      猜你喜欢
      • 2023-02-20
      • 1970-01-01
      • 1970-01-01
      • 2020-03-17
      • 1970-01-01
      • 2022-09-29
      • 1970-01-01
      • 1970-01-01
      • 2017-04-25
      相关资源
      最近更新 更多