编写或尝试更改VS Code设置时出错

时间:2018-12-18 18:03:33

标签: json visual-studio-code

尝试更改设置时出现此错误 无法写入用户设置。请打开用户设置以更正其中的错误/警告,然后重试。 也许我凝视了太久了,但是我看不到哪里有错误。如果我手动将设置复制到文件中,例如底部的“ workbench.sideBar.location”:“ right” ,则可以正常工作。有人可以在这里看到我的json错误吗?版本1.30.0。这是在更新到最新版本之前发生的

{
"files.autoSave": "onFocusChange",
"editor.fontSize": 18,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"beautify.tabSize": 2,
"emmet.triggerExpansionOnTab": true,
"bracketPairColorizer.colorMode": "Independent",
"workbench.iconTheme": "material-icon-theme",
"workbench.tips.enabled": false,
"editor.parameterHints": false,
"highlight-matching-tag.leftStyle": {
"borderWidth": "0 0 0 3px",
"borderStyle": "dotted",
"borderColor": "yellow",
"borderRadius": "5px"
},
"highlight-matching-tag.rightStyle": {
"borderWidth": "0 3px 0 0",
"borderStyle": "dotted",
"borderColor": "yellowd",
"borderRadius": "5px"
},
"bracketPairColorizer.independentPairColors": [
["()", ["Aqua", "Orchid", "LightSkyBlue"], "Red"],
["[]", ["LightSkyBlue", "Orchid", "yellow"], "Red"],
["{}", ["LightSkyBlue", "Orchid", "Aqua"], "Red"]
],
"bracketPairColorizer.consecutivePairColors": [
["</", ">"],
["<", "/>"],
"<>",
["Gold", "Orchid", "LightSkyBlue"],
"Red"
],
"git.enableSmartCommit": true,
"editor.minimap.enabled": false,
"git.autofetch": true,
"php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.1.9\\php.exe",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"workbench.colorTheme": "Default High Contrast",
"files.trimTrailingWhitespace": true,
"php-cs-fixer.executablePath": "${extensionPath}\\php-cs-fixer.phar",
"php-cs-fixer.lastDownload": 1538537777147,
"phpformatter.pharPath": "php-cs-fixer.phar",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"zenMode.hideTabs": false,
"workbench.startupEditor": "newUntitledFile",
"editor.autoClosingQuotes": "always",
"better-comments.highlightPlainText": true,
"emmet.includeLanguages": {
"javascript",
"HTML"
},
"workbench.sideBar.location": "right",
}

2 个答案:

答案 0 :(得分:2)

您需要验证settings.json格式,并使用冒号:

{
    "yaml.schemas": {
        "file:///home/yony/.vscode/extensions/docsmsft.docs-yaml-0.2.4/schemas/toc.schema.json": "/toc\\.yml/i"
    },

    "files.associations": {
        "*.erb": "erb"
    },
    "emmet.includeLanguages": {
        "erb": "html"
    }
}

答案 1 :(得分:1)

人们在一段时间之前发明了JSON验证程序……可能是使用JSON本身。

https://jsonlint.com/