Files
cline-multi-mirror/src/hosts/vscode/hostbridge/env/subscribeToTelemetrySettings.ts
T
Sarah Fortuneandellipsis-dev[bot] b93adc20af Move vscode.env.onDidChangeTelemetryEnabled to the Host Bridge (#6080)
* Add vscode.env.onDidChangeTelemetryEnabled to the Host Bridge

Add a streaming method to the host bridge that returns a message when
the host telemetry setting is changed.

Replace uses of vscode.env.onDidChangeTelemetryEnabled with `subscribeToTelemetrySettings`.

* Apply suggestion from @ellipsis-dev[bot]

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Remove debug logs

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-09-08 16:00:57 -07:00

19 lines
629 B
TypeScript

import * as vscode from "vscode"
import { StreamingResponseHandler } from "@/hosts/vscode/hostbridge-grpc-handler"
import { EmptyRequest } from "@/shared/proto/index.cline"
import { Setting } from "@/shared/proto/index.host"
/**
* Subscribe to changes to the telemetry settings.
*/
export async function subscribeToTelemetrySettings(
_: EmptyRequest,
responseStream: StreamingResponseHandler,
_requestId?: string,
): Promise<void> {
vscode.env.onDidChangeTelemetryEnabled((isTelemetryEnabled) => {
const event = { isEnabled: isTelemetryEnabled ? Setting.ENABLED : Setting.DISABLED }
responseStream(event, false)
})
}