Add experimentation to Microsoft auth (#226107)

* Add experimentation to Microsoft auth

So that we can gradually roll out MSAL support.

* correct order
This commit is contained in:
Tyler James Leonhardt
2024-08-20 17:17:15 -07:00
committed by GitHub
parent b8ad412410
commit c125b90d41
7 changed files with 101 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { getExperimentationService, IExperimentationService, IExperimentationTelemetry, TargetPopulation } from 'vscode-tas-client';
export async function createExperimentationService(
context: vscode.ExtensionContext,
experimentationTelemetry: IExperimentationTelemetry,
isPreRelease: boolean,
): Promise<IExperimentationService> {
const id = context.extension.id;
const version = context.extension.packageJSON['version'];
const service = getExperimentationService(
id,
version,
isPreRelease ? TargetPopulation.Insiders : TargetPopulation.Public,
experimentationTelemetry,
context.globalState,
) as unknown as IExperimentationService;
await service.initializePromise;
await service.initialFetch;
return service;
}