* 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>
19 lines
629 B
TypeScript
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)
|
|
})
|
|
}
|