finalize telemetry enablement api

refs #110267
This commit is contained in:
SteVen Batten 2021-03-09 10:22:51 -08:00
parent 95d3c1e63b
commit 0e43220113
3 changed files with 12 additions and 10 deletions

12
src/vs/vscode.d.ts vendored
View file

@ -7912,6 +7912,18 @@ declare module 'vscode' {
*/
export const isNewAppInstall: boolean;
/**
* Indicates whether the users has telemetry enabled.
* Can be observed to determine if the extension should send telemetry.
*/
export const isTelemetryEnabled: boolean;
/**
* An [event](#Event) which fires when the user enabled or disables telemetry.
* `true` if the user has enabled telemetry or `false` if the user has disabled telemetry.
*/
export const onDidChangeTelemetryEnabled: Event<boolean>;
/**
* The name of a remote. Defined by extensions, popular samples are `wsl` for the Windows
* Subsystem for Linux or `ssh-remote` for remotes using a secure shell.

View file

@ -2716,16 +2716,8 @@ declare module 'vscode' {
readonly allowContributedOpeners?: boolean | string;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/110267
namespace env {
export function openExternal(target: Uri, options?: OpenExternalOptions): Thenable<boolean>;
export const isTelemetryEnabled: boolean;
export const onDidChangeTelemetryEnabled: Event<boolean>;
}
//#endregion

View file

@ -296,11 +296,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
return extHostTerminalService.getDefaultShell(false, configProvider);
},
get isTelemetryEnabled() {
checkProposedApiEnabled(extension);
return extHostTelemetry.getTelemetryEnabled();
},
get onDidChangeTelemetryEnabled(): Event<boolean> {
checkProposedApiEnabled(extension);
return extHostTelemetry.onDidChangeTelemetryEnabled;
},
get isNewAppInstall() {