You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code无法写入设置:settings.json语法错误求助

修复VS Code settings.json语法错误

错误原因分析

  1. 第32行 "editor.guides.bracketPairs": true 末尾缺少逗号,导致后续JSON结构解析失败(对应报错"第33行第3列 预期逗号")。
  2. 错误地将editor.bracketPairColorization.enabled和重复的editor.guides.bracketPairs嵌套在一个多余的对象中,导致JSON无法正确闭合(对应报错"第37行 预期文件结束")。

修正后的完整settings.json

{
  "editor.suggest.localityBonus": true,
  "editor.suggest.statusBar.visible": true,
  "editor.quickSuggestions": null,
  "editor.snippetSuggestions": "bottom",
  "files.autoSave": "afterDelay",
  "liveServer.settings.donotShowInfoMsg": true,
  "workbench.iconTheme": "material-icon-theme",
  "prettier.jsxSingleQuote": true,
  "prettier.singleQuote": true,
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
  "workbench.colorTheme": "Monokai Pro (Filter Spectrum)",
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "emmet.preferences": {
  
  },
  "workbench.editorAssociations": {
    "*.ipynb": "jupyter.notebook.ipynb"
  },
  "mssql.connections": [
    {
      "server": "{{put-server-name-here}}",
      "database": "{{put-database-name-here}}",
      "user": "{{put-username-here}}",
      "password": "{{put-password-here}}"
    }
  ],
  "security.workspace.trust.untrustedFiles": "open",
  "editor.fontSize": 18,
  "editor.tabSize": 3,
  "editor.guides.bracketPairs": "active",
  "editor.bracketPairColorization.enabled": true
}

关键调整说明

  • 给原第32行属性末尾添加逗号,移除多余的嵌套对象括号。
  • 合并重复的editor.guides.bracketPairs属性,保留"active"值(VS Code中该设置有效值为true/false/"active",根据你的需求保留目标值)。

内容的提问来源于stack exchange,提问作者WarriorJm

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 04:18:14