【VS CODE】发布代码片段的方法

【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"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值