Add user setting to enable/disable Continue entirely #8490
Replies: 1 comment
-
|
Hey @sebastienbarre this is an approachable idea. We would accept a contribution for this. Here's a (long) technical guide to implement this feature: OverviewAdd a VS Code setting Implementation Steps1. Add the Configuration SettingFile: Add the new setting to the "continue.enableContinue": {
"type": "boolean",
"default": true,
"description": "Enable or disable Continue's AI features entirely."
}2. Check the Setting Early in Extension ActivationFile: Modify the export function activate(context: vscode.ExtensionContext) {
const config = vscode.workspace.getConfiguration("continue");
const enableContinue = config.get<boolean>("enableContinue");
if (enableContinue === false) {
console.log("Continue is disabled via settings");
return;
}
return dynamicImportAndActivate(context).catch((e) => {
// ... existing error handling
});
}3. Disable Autocomplete When Setting is FalseFile: The autocomplete provider already checks if tab autocomplete is enabled. Update this to also check the main enable setting: const config = vscode.workspace.getConfiguration("continue");
const enableContinue = config.get<boolean>("enableContinue");
const enableTabAutocomplete = getStatusBarStatus() === StatusBarStatus.Enabled;
if (token.isCancellationRequested || !enableTabAutocomplete || !enableContinue) {
return null;
}4. Add a Toggle Command (Optional but Recommended)File: Add a new command in the {
"command": "continue.toggleContinueEnabled",
"category": "Continue",
"title": "Toggle Continue Enabled"
}File: Add the command implementation (around line 537, near "continue.toggleContinueEnabled": () => {
captureCommandTelemetry("toggleContinueEnabled");
const config = vscode.workspace.getConfiguration("continue");
const enabled = config.get<boolean>("enableContinue");
config.update(
"enableContinue",
!enabled,
vscode.ConfigurationTarget.Global,
);
// Show a message to inform the user
const message = !enabled
? "Continue enabled. Reload window to activate."
: "Continue disabled.";
vscode.window.showInformationMessage(message);
}5. Handle Configuration ChangesSince this is a global enable/disable, you may want to prompt the user to reload the window when they change this setting. Add a configuration change listener in // In activateExtension function, add:
context.subscriptions.push(
vscode.workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration("continue.enableContinue")) {
vscode.window
.showInformationMessage(
"Continue enable/disable setting changed. Reload window to apply changes.",
"Reload Window"
)
.then((selection) => {
if (selection === "Reload Window") {
vscode.commands.executeCommand("workbench.action.reloadWindow");
}
});
}
})
);Testing
Key Files to Modify
If you'd like to implement this, the team would be happy to review a PR! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just like Copilot provides the
chat.disableAIFeaturessetting to turn off all AI-related functionality (code completion, chat, next edit, etc., see screenshot below), it would be great if Continue offered a similar option — a single setting to completely disable its AI features, without having to open the Extensions panel, search for it, and manually disable the extension.The advantage is that toggling a user setting can be automated through a keyboard shortcut — much faster that way.
My use case: pressing F1 to toggle between Copilot and Continue
Thank you
Beta Was this translation helpful? Give feedback.
All reactions