Yak*_*uza 9 visual-studio-code vscode-extensions
我正在创建VSCode的扩展,需要配置包含字段的对象数组:a和b.使用扩展文档docs()中提供的信息,我不清楚,如果我可以定义数组元素的配置模式,如果我将属性类型设置为"array".我尝试将以下代码放在"configuration"贡献中,但没有成功(我可以在代码中成功检索配置,但是当用户填写数据时没有IDE提示):
"title": "My config",
"properties": {
"array_property": {
"title": "Property",
"type": "array",
"properties": {
"a": {
"type": "string",
"description": "A a"
},
"b": {
"type": "string",
"description": "A b"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我试图替换"type": "array"与"type": ["array", "object"],但它并没有改变任何东西.
使用这样的示例配置
"configuration": {
"type": "object",
"title": "Test configuration",
"properties": {
"mytest.objarrconf": {
"type": "array",
"items": {
"type": "object",
"title": "inner objects",
"properties": {
"name": {
"type": "string",
"description": "Name of inner object"
},
"size": {
"type": "number",
"description": "Size of inner object"
}
}
},
"default": [],
"description": "my test configurations"
}
}
}
Run Code Online (Sandbox Code Playgroud)
它会导致这个
| 归档时间: |
|
| 查看次数: |
1470 次 |
| 最近记录: |