1. {
  2. "name": "helloworld",
  3. "displayName": "HelloWorld",
  4. "description": "LEAVE BLANK",
  5. "version": "0.0.1",
  6. "engines": {
  7. "vscode": "^1.53.0"
  8. },
  9. "categories": [
  10. "Other"
  11. ],
  12. "activationEvents": [
  13. "onCommand:helloworld.helloWorld"
  14. ],
  15. "main": "./out/extension.js",
  16. "contributes": {
  17. "commands": [
  18. {
  19. "command": "helloworld.helloWorld",
  20. "title": "Hello World"
  21. }
  22. ]
  23. },
  24. "scripts": {
  25. "vscode:prepublish": "npm run compile",
  26. "compile": "tsc -p ./",
  27. "watch": "tsc -watch -p ./",
  28. "pretest": "npm run compile && npm run lint",
  29. "lint": "eslint src --ext ts",
  30. "test": "node ./out/test/runTest.js"
  31. },
  32. "devDependencies": {
  33. "@types/vscode": "^1.53.0",
  34. "@types/glob": "^7.1.3",
  35. "@types/mocha": "^8.0.4",
  36. "@types/node": "^12.11.7",
  37. "eslint": "^7.19.0",
  38. "@typescript-eslint/eslint-plugin": "^4.14.1",
  39. "@typescript-eslint/parser": "^4.14.1",
  40. "glob": "^7.1.6",
  41. "mocha": "^8.2.1",
  42. "typescript": "^4.1.3",
  43. "vscode-test": "^1.5.0"
  44. }
  45. }

activationEvents(激活插件的方式)

onLanguage

onCommand(命令激活)

  1. {
  2. //当输入helloworld.helloWorld命令时,则激活此扩展
  3. "activationEvents":["onCommand:helloworld.helloWorld"]
  4. }

onDebug

onDebugInitialConfigurations

onDebugResolve

workspaceContains

onFileSystem

onView

onUri

onWebviewPanel

onCustomEditor

*

onStartupFinished

contributes

commands(命令)

  1. {
  2. "contributes":{
  3. "commands":[{
  4. "command": "helloworld.helloWorld",
  5. //ctrl+shift+P 打开的命令行会出现这个命令,选择后执行helloworld.helloWorld命令
  6. "title": "Hello World",
  7. }]
  8. }
  9. }

keybindings(键绑定)

  1. {
  2. "contributes":{
  3. "keybindings":[{
  4. "command": "helloworld.helloWorld",
  5. //按下ctrl+F1时触发helloworld.helloWorld命令
  6. "key": "ctrl+f1",
  7. }]
  8. }
  9. }