自定义数据扩展

自定义数据格式允许扩展作者无需编写代码即可轻松扩展 VS Code 的 HTML / CSS 语言支持。

在扩展中使用自定义数据的两个贡献点

  • contributes.html.customData
  • contributes.css.customData

例如,通过在扩展的 package.json 中包含此节

{
  "contributes": {
    "html": {
      "customData": ["./html.html-data.json"]
    },
    "css": {
      "customData": ["./css.css-data.json"]
    }
  }
}

VS Code 将加载这两个文件中定义的 HTML/CSS 实体,并为这些实体提供诸如自动补全和悬停提示等语言支持。

你可以在 microsoft/vscode-extension-samples 中找到 custom-data-sample

English 한국어 中文(简体) 中文(繁體)
© . This website operates independently and is not affiliated with or endorsed by Microsoft. All brand names, logos, and trademarks are the property of their respective owners.