visual-studio-code - Writing a vscode plugin for adding snippets but only for file composer.json
问题描述
Did you know if it's possible to write a vscode plugin to match only a given file?
My plugin already works but add snippets for all .json
files. I wish to be able to add these snippets only if the current file is composer.json
.
My current package.json
(partial) is:
{
"contributes": {
"snippets": [
{
"language": "json",
"path": "./snippets/snippets.code-snippets"
}
]
}
}
The idea is to be able to having something like:
{
"contributes": {
"snippets": [
{
"filename": "composer.json", <-- JUST FOR ILLUSTRATION PURPOSE
"path": "./snippets/snippets.code-snippets"
}
]
}
}
Thanks.
解决方案
推荐阅读
- python-3.x - 在 tkinter 文本中查找关键字
- asp.net - 如何在asp.net核心中分离html文件代码
- mongodb - MongoDB DeleteMany(用户的最新文档组除外)
- python - 将 PHP Curl 转换为 Python 请求
- c# - Microsoft.Graph 4.0.0 创建包含列的列表时出错:错误:为名为“id”的属性找到空值
- python - 如何在 Pandas 系列中使用多个条件替换值?
- flutter - 我附上了一张图片。我正试图对颤振产生这种影响。谁能说出这样的效果是如何产生的?
- javascript - 使用多个图形渲染后访问 Chart.js 数据集
- linux - 如何将文件从多个子文件夹复制到中央文件夹?
- javascript - body-parser 不起作用并且 req.body 返回空