【发布时间】:2019-06-11 05:02:00
【问题描述】:
我的目标是创建一个可在 VSCode 市场中获得的 Snippets 集合。这些 sn-ps 将适用于 3 种语言(html、css 和 JS)。这对从事特定框架工作的任何人都有帮助,尤其是我的团队。
我知道我可以将 sn-ps (How can I add language-agnostic snippets in vscode?) 限定为多种语言。我也知道according to the docs 我应该有一个贡献对象,其中包含一个 sn-ps 数组。在我的package.json 中,我的vsc-extension 默认如下所示:
"contributes": {
"snippets": [
{
"language": "markdown",
"path": "./snippets/markdown.json"
}
]
}
然后将我的 package.json 更新为以下内容是否正确:
"contributes": {
"snippets": [
{
"language": "html",
"path": "./snippets/snippets.json"
},
{
"language": "javacript",
"path": "./snippets/snippets.json"
}
]
}
然后让我的 sn-ps 声明自己的范围 ("scope": "html")?
【问题讨论】:
标签: visual-studio-code vscode-extensions