微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Visual Studio Code .json 文件“预期的逗号”错误

如何解决Visual Studio Code .json 文件“预期的逗号”错误

我正在尝试更改 VS 代码中的某些设置,但一直收到预期的逗号错误。我在其中一行中遇到了这个错误,所以我复制了它并将它移到了底部,但它给了我一个错误,只是为了将它移到下一行。

我试过查这个,但所有的答案似乎都非常小众,而且 vs 代码告诉我没有办法解决它,即使他们告诉我有一个错误

{
    "python.pythonPath": "/usr/local/bin/python3","workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb","filenamePattern": "*.ipynb"
        }
    ],"files.autoSave": "afterDelay","workbench.iconTheme": "material-icon-theme","editor.fontSize": 17,"editor.tabSize": 2,"editor.wordWrap": "on","editor.fontligatures": true,"workbench.sideBar.location": "right","window.title": "${activeEditorShort}${separator}${rootName}${rootPath}","tabnine.experimentalAutoImports": true,"kite.showWelcomeNotificationOnStartup": false,"AREPL.pythonPath": "python3","code-runner.runInTerminal": true,"editor.fontFamily": "Fira Code,Menlo,Monaco,'Courier New',monospace","workbench.colorTheme": "Cobalt2"
    "files.trimTrailingWhitespace": true,"editor.fontWeight": "400","prettier.eslintIntegration": true,"editor.cursorStyle": "line","editor.cursorWidth": 5,"editor.cursorBlinking": "solid","editor.renderWhitespace": "all","editor.lineHeight": 25,"editor.letterSpacing": 0.5,"editor.semanticHighlighting.enabled": false
}

不知道为什么关闭的“}”出现在底部,但它在我的代码中。

解决方法

您在第 22 行末尾遗漏了一个逗号 "workbench.colorTheme": "Cobalt2"

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。