vscode-snippet扩展
vscode-snippet扩展.
相关资料
- 参考官方例子: snippet-sample
- 官方文档: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_global-snippets
- 他人文档: https://blog.csdn.net/maokelong95/article/details/54379046
快速生成代码片段 snippets
使用非常简单, 新建一个 snippets_js.json 文件
1
2
3
4
5
6
7
8
9
10{
"Print to console": {
"prefix": "log", # 提示关键字
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console wilker"
}
}在 package.json 中指定 javascript 文件,时使用 这个代码提示
1
2
3
4
5
6
7
8"contributes": {
"snippets": [
{
"language": "javascript",
"path": "./snippets/snippets_js.json"
}
]
}运行测试