【问题标题】:VS code showing warning when creating a new themeVS 代码在创建新主题时显示警告
【发布时间】:2021-07-18 13:38:27
【问题描述】:

我正在尝试创建一个新的 VS Code 主题,但是每当我尝试运行调试器时,VS 代码都会显示警告“您没有用于调试 'JSON with cmets' 的扩展名。我们是否应该找到一个 'JSON with cmets 在市场上的扩展?'

我的 launch.json 文件:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Extension",
      "type": "extensionHost",
      "request": "launch",
      "args": ["--extensionDevelopmentPath=${workspaceFolder}"]
    }
  ]
}

我的 package.json 文件:

{
    "name": "theme",
    "displayName": "theme",
    "description": "theme",
    "version": "0.0.1",
    "engines": {
        "vscode": "^1.58.0"
    },
    "categories": [
        "Themes"
    ],
    "contributes": {
        "themes": [
            {
                "label": "theme",
                "uiTheme": "vs-dark",
                "path": "./themes/theme-color-theme.json"
            }
        ]
    }
}

我尝试在市场上使用 cmets 调试器查找 JSON,但找不到。有谁知道我做错了什么?

【问题讨论】:

  • 没有 JSONC 调试器之类的东西。它只是您使用的无效配置,请参阅下面的答案。

标签: visual-studio-code vscode-extensions vscode-debugger


【解决方案1】:

调试主题时,您的 "./.vscode/launch.json" 应如下所示:


  // "./.vscode/launch.json"

  {
      "configurations": [
          {
              "args": ["--extensionDevelopmentPath=${workspaceFolder}"],
              "name": "Launch Extension",
              "request": "launch",
              "type": "pwa-extensionHost"
          }
      ]
  }


"你总共只需要四 (4) 个设置,它们显示在上面的 sn-p 中。调试主题时,其他一切都是不必要的垃圾。"


你还需要做一件事:

"./themes/theme-color-theme.json" 文件的最顶部添加以下几行:

    // "./themes/theme-color-theme.json"

    {
        "name": "Your-themes-name",
        "type": "dark",
        "$schema": "vscode://schemas/color-theme",

        "colors": { 
            // theme highlighting...
         },
    }

编辑:


我无意中将"semanticHighlighting": true 添加到了上面的sn-p 中。那是与此问题无关的内容,因此我将其从示例中删除。不过,语义突出显示很重要,如果您还没有阅读过它,那么您应该在选择真或假之前阅读它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-18
    • 2020-11-04
    相关资源
    最近更新 更多