The package.json
file is where you define your extension's metadata, including commands. Update it to include your new command:
{
"name": "my-vscode-extension",
"displayName": "My VS Code Extension",
"description": "A custom VS Code extension to supercharge your workflow.",
"version": "0.0.1",
"engines": {
"vscode": "^1.50.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.showHelloWorld"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "extension.showHelloWorld",
"title": "Show Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^8.0.4",
"@types/node": "^14.14.6",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
"eslint": "^7.11.0",
"glob": "^7.1.6",
"mocha": "^8.2.1",
"typescript": "^4.0.5",
"vscode-test": "^1.4.0"
}
}