【发布时间】:2017-03-14 01:24:46
【问题描述】:
contributes.jsonValidation 的文档说:
url 值可以是扩展中包含的架构文件的本地路径,也可以是远程服务器 URL,例如 json 架构存储。
URL 值按描述工作:
"jsonValidation": [{
"fileMatch": ".jshintrc",
"url": "http://json.schemastore.org/jshintrc"
}]
但是,如果我创建一个测试扩展并提供一个指向我的扩展本地文件的路径,它不会:
"jsonValidation": [{
"fileMatch": "*.testing",
"url": "/schemas/testing.schema.json"
}]
我的扩展程序根目录有一个文件夹schemas,其中有一个文件testing.schema.json。它只是 jshintrc 架构的副本。
当我启动我的测试扩展并加载一个与模式匹配的文件时,我在第一个左大括号下得到一个绿色的小波浪线。如果我将鼠标悬停在绿色曲线上,我会看到一个熟悉的错误:
无法从 '/schemas/edfoo.schema.json' 加载架构:ttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" rel="nofollow" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
IIS 10.0 详细错误 - 404.0 - 未找到
显然,它正在访问服务器,而不是从扩展程序中读取本地文件。但是文档说我可以在扩展中包含一个模式文件。如何让它发挥作用?
【问题讨论】:
标签: visual-studio-code vscode-extensions