【VS CODE】发布代码片段的方法
1、准备代码片段文件 test_vsc.json
而不是.code-snippets
这个后缀的文件
2、本地建立代码库
test_VSC
包含.git
文件夹和snippets
文件夹,代码片段文件放在snippets
文件夹中。
3、win+r 运行 “CMD” 定位到代码库路径
4、执行初始化package.json命令
npm inti
5、输入扩展包名(这里要注意,包名只能如下范围)
**String does not match the pattern of "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$".**
但实测下来好像不支持大写,不支持下划线,需要谨慎
6、package.json的格式如下
{
"name": "test-vsc",
"version": "0.0.2",
"description": "test publish",
"publisher": "TracyPan",
"main": "index.js",
"engines": {
"vscode": "^1.18.0"
},
"keywords": [
"fanuc picture"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/BFMdeveloper/test_VSC1.git"
},
"author": "panxu",
"license": "ISC",
"categories"