首页 > 解决方案 > VS Code - 无法写入用户设置

问题描述

每当我尝试应用任何新主题或更改字体时,我总是会收到上述错误。然后它打开我在下面粘贴的 settings.json

    "editor.accessibilitySupport": "on",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "python.languageServer": "Microsoft",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
    "python.defaultInterpreterPath": "C:\\Python39\\python.exe",
    "workbench.iconTheme": "material-icon-theme",
    "java.semanticHighlighting.enabled": true,
    "window.zoomLevel": 0,
    "editor.multiCursorModifier": "ctrlCmd",
    "workbench.colorTheme": "Vue Theme",
    "tabnine.experimentalAutoImports": true,
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "text.html.markdown.journal.task.open.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.marker",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.text",
                "settings": {}
            },
            {
                "scope": "text.html.markdown.journal.task.completed.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.marker",
                "settings": {
                    "foreground": "#AAAAAA"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.text",
                "settings": {
                    "foreground": "#AAAAAA"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.memo.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.memo.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.scope",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.link.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.link.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            }
        ]
    },
    "C_Cpp.updateChannel": "Insiders",
    "editor.fontLigatures": true,
    "editor.autoClosingBrackets": "always",
    "editor.tabSize": 4,
    "editor.fontFamily": "Cascadia Code",
    "editor.cursorBlinking": "expand",
    "window.title": "${dirty}${activeEditorShort}${separator}${rootName}${appName}",
    "files.autoSave": "afterDelay",
    "code-runner.runInTerminal": true,
    "git.ignoreMissingGitWarning": true,
    "terminal.integrated.rendererType": "dom",
    "python.showStartPage": false,
    "todo-tree.tree.showScanModeButton": false,
    "dateTime.locale": ""
    "dateTime.use24HourClock": false
    "dateTime.showAMPM": true
    "dateTime.showDayOfWeek": true
    "dateTime.showMonth": true
    "dateTime.showDayOfMonth": true
}

由于我在 JSON 方面没有太多经验,我无法理解错误在哪里。请尽快帮助我。提前致谢!

标签: visual-studio-code

解决方案


您粘贴的 json 文件一开始需要一个左大括号。

您还缺少很多逗号。

{
    "editor.accessibilitySupport": "on",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "python.languageServer": "Microsoft",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
    "python.defaultInterpreterPath": "C:\\Python39\\python.exe",
    "workbench.iconTheme": "material-icon-theme",
    "java.semanticHighlighting.enabled": true,
    "window.zoomLevel": 0,
    "editor.multiCursorModifier": "ctrlCmd",
    "workbench.colorTheme": "Vue Theme",
    "tabnine.experimentalAutoImports": true,
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "text.html.markdown.journal.task.open.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.marker",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.open.text",
                "settings": {}
            },
            {
                "scope": "text.html.markdown.journal.task.completed.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.marker",
                "settings": {
                    "foreground": "#AAAAAA"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.text",
                "settings": {
                    "foreground": "#AAAAAA"
                }
            },
            {
                "scope": "text.html.markdown.journal.task.completed.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.memo.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.memo.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.scope",
                "settings": {
                    "foreground": "#FFFF00"
                }
            },
            {
                "scope": "text.html.markdown.journal.link.keyword",
                "settings": {
                    "fontStyle": "italic"
                }
            },
            {
                "scope": "text.html.markdown.journal.link.bullet",
                "settings": {
                    "foreground": "#FFFF00"
                }
            }
        ]
    },
    "C_Cpp.updateChannel": "Insiders",
    "editor.fontLigatures": true,
    "editor.autoClosingBrackets": "always",
    "editor.tabSize": 4,
    "editor.fontFamily": "Cascadia Code",
    "editor.cursorBlinking": "expand",
    "window.title": "${dirty}${activeEditorShort}${separator}${rootName}${appName}",
    "files.autoSave": "afterDelay",
    "code-runner.runInTerminal": true,
    "git.ignoreMissingGitWarning": true,
    "terminal.integrated.rendererType": "dom",
    "python.showStartPage": false,
    "todo-tree.tree.showScanModeButton": false,
    "dateTime.locale": "",
    "dateTime.use24HourClock": false,
    "dateTime.showAMPM": true,
    "dateTime.showDayOfWeek": true,
    "dateTime.showMonth": true,
    "dateTime.showDayOfMonth": true
}

推荐阅读