I'm developing an extension for Visual Studio Code (in Visual Studio Code), and I want to add one more button to the pop-up menu when a user clicks ctrl + right click
. A visual representation of what I'm trying to convey is shown below:
However, I'm not sure how to do this, and I couldn't find documentation about it either.
You need to implement a menu contribution. You can find related docs at https://code.visualstudio.com/api/references/contribution-points#contributes.menus. In your extension manifest (package.json), fill in the appropriate config in contributes
> menus
. The screenshot you've shown is of the editor/context
menu. You register the menu item contribution with a corresponding command that clicking the menu item will call, and then you implement the command in the same way you'd implement any other command contribution (see also https://code.visualstudio.com/api/references/contribution-points#contributes.commands).
If you want to see an example of an extension that contributes a menu, see https://github.com/Microsoft/vscode-extension-samples/tree/main/source-control-sample.