Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,8 @@ export interface IDE {

// Callbacks
onDidChangeActiveTextEditor(callback: (fileUri: string) => void): void;

updateTelemetryEnabled(enabled: boolean): Promise<void>;
}

// Slash Commands
Expand Down
2 changes: 2 additions & 0 deletions core/protocol/ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export type ToIdeFromWebviewOrCoreProtocol = {
logoutOfControlPlane: [undefined, void];
reportError: [any, void];
closeSidebar: [undefined, void];

updateTelemetryEnabled: [{ enabled: boolean }, void];
};

export type ToWebviewOrCoreFromIdeProtocol = {
Expand Down
4 changes: 4 additions & 0 deletions core/protocol/messenger/messageIde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,8 @@ export class MessageIde implements IDE {
async getBranch(dir: string): Promise<string> {
return this.request("getBranch", { dir });
}

async updateTelemetryEnabled(enabled: boolean): Promise<void> {
return this.request("updateTelemetryEnabled", { enabled });
}
}
4 changes: 4 additions & 0 deletions core/protocol/messenger/reverseMessageIde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,9 @@ export class ReverseMessageIde {
this.on("getBranch", (data) => {
return this.ide.getBranch(data.dir);
});

this.on("updateTelemetryEnabled", (data) => {
return this.ide.updateTelemetryEnabled(data.enabled);
});
}
}
4 changes: 4 additions & 0 deletions core/util/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ class FileSystemIde implements IDE {
async subprocess(command: string, cwd?: string): Promise<[string, string]> {
return ["", ""];
}

async updateTelemetryEnabled(enabled: boolean): Promise<void> {
return Promise.resolve();
}
}

export default FileSystemIde;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.github.continuedev.continueintellijextension.browser.ContinueBrowserS
import com.github.continuedev.continueintellijextension.editor.DiffStreamService
import com.github.continuedev.continueintellijextension.editor.EditorUtils
import com.github.continuedev.continueintellijextension.error.ContinueSentryService
import com.github.continuedev.continueintellijextension.error.ContinueTelemetryStatusService

import com.github.continuedev.continueintellijextension.protocol.*
import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
Expand Down Expand Up @@ -166,6 +168,18 @@ class IdeProtocolClient(
respond(isEnabled)
}

"updateTelemetryEnabled" -> {
val enabled = try {
dataElement.asJsonObject.get("enabled").asBoolean
} catch (_: Exception) {
null
}
if (enabled != null) {
service<ContinueTelemetryStatusService>().updateAllowAnonymousTelemetry(enabled)
}
respond(null)
}

"readRangeInFile" -> {
val params = Gson().fromJson(
dataElement.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class ContinueTelemetryStatusService : ContinueTelemetryStatus {
}
}

fun updateAllowAnonymousTelemetry(enabled: Boolean) {
allowAnonymousTelemetry = enabled
}


private companion object {
const val DISABLED_FALLBACK = false
}
Expand Down
6 changes: 6 additions & 0 deletions extensions/vscode/src/VsCodeIde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { getExtensionUri, openEditorAndRevealRange } from "./util/vscode";
import { VsCodeWebviewProtocol } from "./webviewProtocol";

import type {

Check warning on line 21 in extensions/vscode/src/VsCodeIde.ts

View workflow job for this annotation

GitHub Actions / vscode-checks

There should be at least one empty line between import groups
DocumentSymbol,
FileStatsMap,
FileType,
Expand All @@ -33,7 +33,7 @@
TerminalOptions,
Thread,
} from "core";
import { getExtensionVersion, isExtensionPrerelease } from "./util/util";

Check warning on line 36 in extensions/vscode/src/VsCodeIde.ts

View workflow job for this annotation

GitHub Actions / vscode-checks

`./util/util` import should occur before import of `./util/vscode`

class VsCodeIde implements IDE {
ideUtils: VsCodeIdeUtils;
Expand Down Expand Up @@ -698,6 +698,12 @@
const ideSettings = this.getIdeSettingsSync();
return ideSettings;
}

async updateTelemetryEnabled(enabled: boolean): Promise<void> {
vscode.workspace
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Await the VS Code configuration update so the promise resolves only after the telemetry setting is written.

Prompt for AI agents
Address the following comment on extensions/vscode/src/VsCodeIde.ts at line 703:

<comment>Await the VS Code configuration update so the promise resolves only after the telemetry setting is written.</comment>

<file context>
@@ -698,6 +698,12 @@ class VsCodeIde implements IDE {
   }
+
+  async updateTelemetryEnabled(enabled: boolean): Promise&lt;void&gt; {
+    vscode.workspace
+      .getConfiguration(&quot;continue&quot;)
+      .update(&quot;telemetryEnabled&quot;, enabled, vscode.ConfigurationTarget.Global);
</file context>
Suggested change
vscode.workspace
await vscode.workspace

✅ Addressed in d7c5494

.getConfiguration("continue")
.update("telemetryEnabled", enabled, vscode.ConfigurationTarget.Global);
}
}

export { VsCodeIde };
4 changes: 4 additions & 0 deletions extensions/vscode/src/extension/VsCodeMessenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,5 +832,9 @@ export class VsCodeMessenger {
this.onWebviewOrCore("reportError", async (msg) => {
await handleLLMError(msg.data);
});

this.onWebviewOrCore("updateTelemetryEnabled", async (msg) => {
return await ide.updateTelemetryEnabled(msg.data.enabled);
});
}
}
7 changes: 4 additions & 3 deletions gui/src/pages/config/sections/UserSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ export function UserSettingsSection() {
description="Allows Continue to send anonymous telemetry."
value={allowAnonymousTelemetry}
disabled={disableTelemetryToggle}
onChange={(value) =>
handleUpdate({ allowAnonymousTelemetry: value })
}
onChange={(value) => {
handleUpdate({ allowAnonymousTelemetry: value });
void ideMessenger.ide.updateTelemetryEnabled(value);
}}
/>
</div>
</Card>
Expand Down
Loading