在VS代码中,有几个标记触发本地文件路径引用的自动完成和验证。例如,输入img标记时:
图像.json
[
{
"color": "red",
"path": "./images/kitten.jpeg"
},
]
这是一个
JSON Schema Definition
一直以来
applied to the vs workplace settings
.vscode代码/设置.json
{
"json.schemas": [
{
"fileMatch": [
"/images.json"
],
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": [
{
"type": "object",
"properties": {
"color": {"type": "string", "enum": ["blue", "red", "green"]},
"path": {"type": "string", },
}
},
]
}
}
]
}
有没有方法可以使用检查本地文件路径
JSON Schema Validation
或者用其他方法告诉VS代码某个字段代表本地文件引用?