菜單擴展是通過配置擴展點來註冊的,一般要關聯一個命令。擴展方式是在package.json中contributes節點下增加menus擴展點。相關代碼如下:
"contributes": {"menus": {"editor/context": [{"command": "extension.helloWorld","group": "z_commands","when": "editorTextFocus"},{"group": "z_commands"}]}}
菜單擴展點詳細的說明請參考這裏menus
