I am creating a VS Code extension. I want to add a custom button to the Git message field of the VS Code Source Control tab?
To be specific location, please see the screenshot below:
I want to add a custom button to this location. Just like GitHub Copilot did.
So my question are:
- How to add button to it?
- How can I put generated message to the "Message" field?

You need to use the
contribSourceControlInputBoxMenuAPI proposal. See also its issue ticket: SourceControl - SourceControlInputBoxValueProvider API proposal #195474.The API proposal is current empty. At a previous point in time, it looked like this:
You could take a look at the GitHub Copilot Chat extension's minified code as an example (download VSIX, rename filename extension to ".zip", unzip). In its extension manifest, it has this:
See also https://code.visualstudio.com/api/advanced-topics/using-proposed-api.
When the API still existed, the way to change the value of the input box was
vscode.extensions.getExtension('vscode.git')?.exports.getAPI(1).repositories[0].inputBox.value = newvalue;.Note that later versions of GitHub Copilot started using the
scminputlanguage instead of thescm/inputboxmenu contribution point (see thegithub.copilot.enablesetting).