Skip to content

Commit 1acca25

Browse files
authored
exp: use corresponding target population per edition (#727)
Signed-off-by: Yan Zhang <[email protected]>
1 parent c11609e commit 1acca25

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/exp/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as vscode from "vscode";
55
import { IExperimentationService, IExperimentationTelemetry, TargetPopulation, getExperimentationServiceAsync } from "vscode-tas-client";
66
import { addContextProperty, sendInfo } from "vscode-extension-telemetry-wrapper";
7-
import { getExtensionName, getExtensionVersion } from "../utils";
7+
import { getExtensionName, getExtensionVersion, isInsiders } from "../utils";
88

99
class ExperimentationTelemetry implements IExperimentationTelemetry {
1010

@@ -29,11 +29,15 @@ export function getExpService() {
2929
return expService;
3030
}
3131

32+
function getTargetPopulation() {
33+
return isInsiders() ? TargetPopulation.Insiders : TargetPopulation.Public;
34+
}
35+
3236
export async function initialize(context: vscode.ExtensionContext) {
3337
expService = await getExperimentationServiceAsync(
3438
getExtensionName(),
3539
getExtensionVersion(),
36-
TargetPopulation.Insiders,
40+
getTargetPopulation(),
3741
new ExperimentationTelemetry(),
3842
context.globalState
3943
);

src/utils/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ export async function webviewCmdLinkHandler(obj: { webview: string, identifier:
6565
await vscode.commands.executeCommand(command);
6666
}
6767
}
68+
69+
export function isInsiders() {
70+
return vscode.env.appName.indexOf('Insider') > 0 || vscode.env.appName.indexOf('OSS') > 0;
71+
}

0 commit comments

Comments
 (0)