Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vscode如何支持自动json验证https://schemastore.org/json/?_Json_Visual Studio Code - Fatal编程技术网

vscode如何支持自动json验证https://schemastore.org/json/?

vscode如何支持自动json验证https://schemastore.org/json/?,json,visual-studio-code,Json,Visual Studio Code,VSCode是否应该在JSON文件中具有自动智能感知?如果是,它是如何工作的?我知道它适用于众所周知的JSON文件,比如tsconfig.JSON,但是其他资源比如stryker.conf.JSON呢 在许多在线资源中,我读到它应该自动适用于中的任何模式,例如:。然而,它似乎不适用于stryker.conf.json,但是,它在模式存储中 只要JSON有有效的模式可供使用,VSCode就会为JSON提供intellisense,托管在schemastore.org或其他任何地方。它只需要知道对

VSCode是否应该在JSON文件中具有自动智能感知?如果是,它是如何工作的?我知道它适用于众所周知的JSON文件,比如tsconfig.JSON,但是其他资源比如stryker.conf.JSON呢

在许多在线资源中,我读到它应该自动适用于中的任何模式,例如:。然而,它似乎不适用于stryker.conf.json,但是,它在模式存储中


只要JSON有有效的模式可供使用,VSCode就会为JSON提供intellisense,托管在schemastore.org或其他任何地方。它只需要知道对哪些文件使用什么模式

正如您所注意到的,VSCode只是“知道”对某些已知文件使用什么模式,如
tsconfig.json

对于其他文件,您可以直接在JSON中指定模式,这是VSCode在屏幕截图中提示您执行的操作:

如果不想在JSON文件本身中指定模式,可以在
设置中将文件模式映射到模式。JSON

  "json.schemas": [
    {
      "fileMatch": ["stryker.conf.json"],
      "url": "https://raw.githubusercontent.com/stryker-mutator/stryker/master/packages/api/schema/stryker-core.json"
    }
  ]

您会说:“它只需要知道对哪些文件使用什么模式”。这是schemastore还提供的“fileMatch”:但不使用fileMatch?如果是这样,是否有支持的文件的硬编码列表,其中包含架构位置?我想把stryker.conf.json添加到这个列表中。这可能是你想要的,也可能不是。祝你好运免责声明:我不是VSCode开发人员。谢谢。如果你在答案中加上这个,我会把它标记为解决方案。太糟糕了,vscode没有动态解析:/