Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686

This commit is contained in:
ADS Merger
2020-08-22 06:06:52 +00:00
committed by Anthony Dresser
parent 404260b8a0
commit 4ad73d381c
480 changed files with 14360 additions and 14122 deletions

View File

@@ -12,9 +12,10 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
import { ITelemetryData } from 'vs/base/common/actions';
import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const storageKey = 'VSCode.ABExp.FeatureData';
const refetchInterval = 1000 * 60 * 30; // By default it's set up to 30 minutes.
const refetchInterval = 0; // no polling
class MementoKeyValueStorage implements IKeyValueStorage {
constructor(private mementoObj: MementoObject) { }
@@ -160,13 +161,18 @@ export class ExperimentService implements ITASExperimentService {
private tasClient: Promise<TASClient> | undefined;
private static MEMENTO_ID = 'experiment.service.memento';
private get experimentsEnabled(): boolean {
return this.configurationService.getValue('workbench.enableExperiments') === true;
}
constructor(
@IProductService private productService: IProductService,
@ITelemetryService private telemetryService: ITelemetryService,
@IStorageService private storageService: IStorageService
@IStorageService private storageService: IStorageService,
@IConfigurationService private configurationService: IConfigurationService,
) {
if (this.productService.tasConfig) {
if (this.productService.tasConfig && this.experimentsEnabled && this.telemetryService.isOptedIn) {
this.tasClient = this.setupTASClient();
}
}
@@ -176,6 +182,10 @@ export class ExperimentService implements ITASExperimentService {
return undefined;
}
if (!this.experimentsEnabled) {
return undefined;
}
return (await this.tasClient).getTreatmentVariable<T>('vscode', name);
}