{ "name": "helloworld", "displayName": "HelloWorld", "description": "", "version": "0.0.1", "engines": { "vscode": "^1.30.0" }, "categories": [ "Other" ], "activationEvents": [ "onCommand:extension.helloWorld", "onCommand:extension.loginValidate" ], "main": "./out/loginValidate", "contributes": { "commands": [ { "command": "extension.helloWorld", "title": "登录" }, { "command": "extension.loginValidate", "title": "登录验证" } ] }, "scripts": { "vscode:prepublish": "npm run compile", "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "devDependencies": { "typescript": "^3.1.4", "vscode": "^1.1.25", "tslint": "^5.8.0", "@types/node": "^8.10.25", "@types/mocha": "^2.2.42" } }
两者对比,后者更简单。
注意:其中我主要改写官方的这一部分