Skip to content

Commit

Permalink
Setting to disable online experiments #54354
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Aug 1, 2018
1 parent 7dc16e9 commit 3cd7cc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/vs/workbench/electron-browser/main.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,12 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('settingsTocVisible', "Controls whether the settings editor Table of Contents is visible."),
'default': true,
'scope': ConfigurationScope.WINDOW
},
'workbench.enableExperiments': {
'type': 'boolean',
'description': nls.localize('workbench.enableExperiments', "Fetches experiments to run from a Microsoft online service."),
'default': true,
'tags': ['usesOnlineServices']
}
}
});
Expand Down
12 changes: 5 additions & 7 deletions src/vs/workbench/parts/experiments/node/experimentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';

import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IExtensionManagementService, LocalExtensionType } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IRequestService } from 'vs/platform/request/node/request';

import { TPromise } from 'vs/base/common/winjs.base';
import { language } from 'vs/base/common/platform';
import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
import { match } from 'vs/base/common/glob';
import { asJson } from 'vs/base/node/request';

import { Emitter, Event } from 'vs/base/common/event';
import { ITextFileService, StateChange } from 'vs/workbench/services/textfile/common/textfiles';
import { WorkspaceStats } from 'vs/workbench/parts/stats/node/workspaceStats';
import { Emitter, Event } from 'vs/base/common/event';


interface IExperimentStorageState {
enabled: boolean;
Expand Down Expand Up @@ -123,7 +120,8 @@ export class ExperimentService extends Disposable implements IExperimentService
@IEnvironmentService private environmentService: IEnvironmentService,
@ITelemetryService private telemetryService: ITelemetryService,
@ILifecycleService private lifecycleService: ILifecycleService,
@IRequestService private requestService: IRequestService
@IRequestService private requestService: IRequestService,
@IConfigurationService private configurationService: IConfigurationService
) {
super();

Expand Down Expand Up @@ -167,7 +165,7 @@ export class ExperimentService extends Disposable implements IExperimentService
}

protected getExperiments(): TPromise<IRawExperiment[]> {
if (!product.experimentsUrl) {
if (!product.experimentsUrl || this.configurationService.getValue('workbench.enableExperiments') === false) {
return TPromise.as([]);
}
return this.requestService.request({ type: 'GET', url: product.experimentsUrl }).then(context => {
Expand Down

0 comments on commit 3cd7cc3

Please sign in to comment.