自訂資料延伸模組

自訂資料格式 (Custom Data format) 允許擴充功能開發者在無需撰寫程式碼的情況下,輕鬆擴充 VS Code 的 HTML / CSS 語言支援。

在擴充功能中使用自訂資料的兩個 貢獻點 (Contribution Points) 為:

  • 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

© . This site is unofficial and not affiliated with Microsoft.