Reputation: 33104
I'm using the VS Code GitHub Copilot extension. Sometimes I edit files that contain secrets, and I don't want to accidentally send those to Microsoft/GitHub.
Is it possible to make Copilot opt-in, so that it is only enabled if I have explicitly activated it for a project?
Upvotes: 12
Views: 4274
Reputation: 3085
You can do it in the UI, but it's a bit hidden.
Go to Settings
-> Extensions
-> GitHub Copilot
-> Disable
Then click on the dropdown arrow next to the Enable
button and choose Enable (Workspace)
Upvotes: 11
Reputation: 525
You can currently enable/disable Copilot only globally for the user or on a per-language basis through the UI.
However, you can disable Copilot globally and overwrite the setting directly in the settings.json file for a specific workspace. For that, edit or create the file .vscode/settings.json
with this content:
{
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false
},
}
As noted in the comments, the UI can guide you a little:
You still need to edit settings.json but at least you get a handy button that opens it for editing for you, with default values.
Upvotes: 5
Reputation: 108
You can disable the extension and then enable for only the projects and workspaces you want it to be enabled.
Upvotes: 3