可以在我的设置中找到问题。

发布于 2025-02-12 01:53:57 字数 1855 浏览 0 评论 0原文

我开始使用MS VS代码,并想应用一些基本设置。他们都可以工作,但是我现在无法添加扩展名,接收到“无法写入用户设置”的错误消息。

似乎我的设置有问题。这是我的代码:

    {
        
        "workbench.colorTheme": "One Dark Pro",
        "editor.quickSuggestions": {
    
             "other": "on",
             "comments": "off",
             "strings": "off" },
         
        "[markdown]": {
            "editor.quickSuggestions": true,
        },
        "atomKeymap.promptV3Features": true,
    
    
    "editor.tokenColorCustomizations": {
           "textMateRules": [
            {
                "scope": "heading.1.markdown entity.name.section.markdown, heading.1.markdown punctuation.definition.heading.markdown",
                 "settings": {
                     "foreground": "#0981D1",
                 }
             },  
            {
                  "scope": "heading.2.markdown entity.name.section.markdown, heading.2.markdown punctuation.definition.heading.markdown",
                   "settings": {
                       "foreground": "#9cecfb",
                   }
               },
               {
                   "scope": "heading.3.markdown entity.name.section.markdown, heading.3.markdown punctuation.definition.heading.markdown",
                   "settings": {
                       "foreground": "#83a4d4",
                   }
                }
                {
                "scope": "markup.italic",
                "settings": {
                    "foreground": "#ff7b00e0",
                    "fontStyle": "bold",
                }
                }   
                {
                "scope": "markup.bold",
                "settings": {
                    "foreground": "#26ca5c",
                    "fontStyle": "bold",
                }
                }
             ]
         }
     
        }

I started using MS VS Code and wanted to apply some basic settings. They all do work, however I can't add an extension right now, receiving the error message "unable to write into user settings".

Seems like I have something wrong in my settings.json but I don't know what? Here is my code:

    {
        
        "workbench.colorTheme": "One Dark Pro",
        "editor.quickSuggestions": {
    
             "other": "on",
             "comments": "off",
             "strings": "off" },
         
        "[markdown]": {
            "editor.quickSuggestions": true,
        },
        "atomKeymap.promptV3Features": true,
    
    
    "editor.tokenColorCustomizations": {
           "textMateRules": [
            {
                "scope": "heading.1.markdown entity.name.section.markdown, heading.1.markdown punctuation.definition.heading.markdown",
                 "settings": {
                     "foreground": "#0981D1",
                 }
             },  
            {
                  "scope": "heading.2.markdown entity.name.section.markdown, heading.2.markdown punctuation.definition.heading.markdown",
                   "settings": {
                       "foreground": "#9cecfb",
                   }
               },
               {
                   "scope": "heading.3.markdown entity.name.section.markdown, heading.3.markdown punctuation.definition.heading.markdown",
                   "settings": {
                       "foreground": "#83a4d4",
                   }
                }
                {
                "scope": "markup.italic",
                "settings": {
                    "foreground": "#ff7b00e0",
                    "fontStyle": "bold",
                }
                }   
                {
                "scope": "markup.bold",
                "settings": {
                    "foreground": "#26ca5c",
                    "fontStyle": "bold",
                }
                }
             ]
         }
     
        }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你对谁都笑 2025-02-19 01:53:57

此错误意味着您的设置文件中的JSON已畸形。您在editor.tokencolorcustomizations的内部有一些错误。应该是:

"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "heading.1.markdown entity.name.section.markdown, heading.1.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#0981D1"
                }
            },
            {
                "scope": "heading.2.markdown entity.name.section.markdown, heading.2.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#9cecfb"
                }
            },
            {
                "scope": "heading.3.markdown entity.name.section.markdown, heading.3.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#83a4d4"
                }
            },
            {
                "scope": "markup.italic",
                "settings": {
                    "foreground": "#ff7b00e0",
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "markup.bold",
                "settings": {
                    "foreground": "#26ca5c",
                    "fontStyle": "bold"
                }
            }
        ]
    }

This error means your JSON in your settings file is malformed. You have some errors inside of editor.tokenColorCustomizations. It should be:

"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "heading.1.markdown entity.name.section.markdown, heading.1.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#0981D1"
                }
            },
            {
                "scope": "heading.2.markdown entity.name.section.markdown, heading.2.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#9cecfb"
                }
            },
            {
                "scope": "heading.3.markdown entity.name.section.markdown, heading.3.markdown punctuation.definition.heading.markdown",
                "settings": {
                    "foreground": "#83a4d4"
                }
            },
            {
                "scope": "markup.italic",
                "settings": {
                    "foreground": "#ff7b00e0",
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "markup.bold",
                "settings": {
                    "foreground": "#26ca5c",
                    "fontStyle": "bold"
                }
            }
        ]
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文