【问题标题】:'Add Item' button in VSCode Extension settingsVSCode 扩展设置中的“添加项目”按钮
【发布时间】:2019-10-03 22:59:01
【问题描述】:

我正在为我的 VSCode 扩展添加 configuration 贡献点。 我想要实现的是拥有图形“添加项目”编辑器,就像 CSS 自定义数据部分一样,如下图所示。

Documentation 似乎提到了可以在设置 UI 中直接编辑的类型 numberstringboolean。 有没有办法让这个编辑器为我自己的配置部分添加“添加项目”按钮?

【问题讨论】:

    标签: visual-studio-code vscode-extensions


    【解决方案1】:

    那是字符串数组的编辑器。已添加到1.37 release(2019 年 7 月)。

    这是一个示例设置定义:

    "configuration": {
        "properties": {
            "foo": {
                "type": "array",
                "items": {
                    "type": "string"
                },
                "default": ["a", "b", "c"]
            }
        }
    }
    

    请注意,目前似乎不支持 string 以外的类型数组。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多