命令
c+s+p
// package.json{"main": "./out/extension.js","activationEvents": ["onCommand:vscode-plugin-learn.helloWorld"],"contributes": {"commands": [{"command": "vscode-plugin-learn.helloWorld","title": "Hello World"}],}}
// extension.jsimport vscode from 'vscode';export function activate(context: vscode.ExtensionContext) {let disposable = vscode.commands.registerCommand('vscode-plugin-learn.helloWorld', (uri) => {vscode.window.showInformationMessage(`Hello World uri:${uri}`);});context.subscriptions.push(disposable);}

右键菜单
// package.json{"contributes": {"menus": {"editor/context": [{"when": "editorFocus","command": "vscode-plugin-learn.helloWorld","group": "navigation"}],}}}

快捷键
{"contributes": {"keybindings": [{"command": "vscode-plugin-learn.helloWorld","key": "ctrl+f11","mac": "cmd+f11","when": "editorTextFocus"}]}}

文件右键
"contributes": {"menus": {"explorer/context": [{"command": "vscode-plugin-learn.helloWorld","group": "navigation"}]}},

右上方icon
"contributes": {"commands": [{"command": "vscode-plugin-learn.helloWorld","title": "Hello World","icon": "./out/images/code.svg"}],"menus": {"editor/title": [{"when": "editorFocus","command": "vscode-plugin-learn.helloWorld","group": "navigation"}]}},

